Would appreciate it if someone helps me with the small task . I want to pass a command line arguments to a powershell script(that is not a file ).
Suppose , i just want to pass an argument that messagebox will show.
powershell.exe -command "$str=$args[0];[System.Reflection.Assembly]::
LoadWithPartialName('System.Windows.Forms');
[System.Windows.Forms.Messagebox]::Show($str);" 'foo'
I want foo to be shown in messagebox. I get empty messagebox. Perhaps i missed something small.
-command "code" arg, do-command "& {code} arg"