JustScriptIt
Technical User
I am writing a simple script to get more familiar with powershell.
This script reads input parameters into a hash
On the command-line, I set the following values$shape = 'circle'; $color = 'pink'; $size = 'large'I then invoke the program with the following command
And, I get the following output:
I am unable to figure out why $states.color is blank. I was expecting the output "Color is pink"
I am following this artical,
Where am I going wrong???
This script reads input parameters into a hash
Code:
$states = @($args)
$states
write-host Color is $states.color
On the command-line, I set the following values$shape = 'circle'; $color = 'pink'; $size = 'large'I then invoke the program with the following command
Code:
.\shapes_n_colors.ps1 $shape $size $color
And, I get the following output:
Code:
circle
large
pink
Color is
I am unable to figure out why $states.color is blank. I was expecting the output "Color is pink"
I am following this artical,
Where am I going wrong???