Purpose:Execute a PowerShell script or string


Format:PSHELL [/C /S script ...]





See also @PSHELL.




Note that you may need to enable PowerShell scripting on your system; on recent versions of Windows it is disabled by default (for security).


PSHELL supports multiple string or filename arguments. If a string or filename has embedded whitespace, you must enclose it with double quotes. For example:


pshell /s "type $Profile"


Without the double quotes PSHELL would interpret this as two commands.




/CClose the persistent PowerShell interpreter


/SExecute a string (like @PSHELL)