Hello Abhinay,
The message displayed by the Show() method must be included in " (quotes) if it contains any text beside your variables. Additionally, variables that are included in double quotes will expand their values at runtime. That means that you should not escape them in the Show() method. Here is a little example so you can better understand what I mean here:
Code: Select all
Add-Type -AssemblyName PresentationFramework
$var1 = "there"
$var2 = "how are you?"
[System.Windows.MessageBox]::Show("Hello $var1 $var2")
The output of the above code will be:
However, if we use single quotes instead of the double quotes (e.g. 'Hello $var1 $var2'), the output will be:
Hope things are a bit more clear now.
With that being said, the input of your Show() method should be:
Code: Select all
[System.Windows.MessageBox]::Show("Your Current $a[0] and your current $a[4]")
respectively:
Code: Select all
[System.Windows.MessageBox]::Show("Your Current $b[0] and your current $b[4]")
Hope this helps.
Best regards,
Catalin