Welcome › Forums › General PowerShell Q&A › including hash sign (#) inside of invoke-expression
This topic contains 1 reply, has 2 voices, and was last updated by
i need to start a program from a ps script that contains the hashsign (#) insilde the program parameters.
can someone help me find the way to do this ?
$command = 'c:\somecommand.exe -msg:text1 -number:#456852,4578684'
$result= invoke-expression $command
i believe that powershell see the # as comment and not reading anything after it
Use the backtick ` should produce what you see below:
$command = 'echo test -number:`#12345678,45682'
Invoke-Expression -Command $command
The topic ‘including hash sign (#) inside of invoke-expression’ is closed to new replies.