The powershell script I have works as expected when opened in powershell
Invoke-WebRequest -Uri host.com -Body "Param1=Value&Param2=Value&Param3=&Param4=Value" -Method POST
but when the same command is passed via cmd as
powershell.exe Invoke-WebRequest -Uri host.com -Body "Param1=Value&Param2=Value&Param3=&Param4=Value" -Method POST
it gives me these errors
'Param1' is not recognized as an internal or external command,
operable program or batch file.
'Param2' is not recognized as an internal or external command,
operable program or batch file.
'Param3' is not recognized as an internal or external command,
operable program or batch file.
'Param4' is not recognized as an internal or external command,
operable program or batch file.
I know it's a syntax problem, but I'm not sure what needs to be changed exactly
EDIT:
powershell.exe Invoke-WebRequest -Uri host.com -Body 'Param1=Value&Param2=Value&Param3=&Param4=Value' -Method POST
That modification did nothing to change the results
powershell -command "Invoke-WebRequest -Uri host.com -Body 'Param1=Value&Param2=Value&Param3=&Param4=Value' -Method POST"