Purpose:Execute a PowerShell script or string

 

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

 

/C(lose)

/S(tring)

 

See also @PSHELL.

 

Usage:

 

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.

 

Option:

 

/CClose the persistent PowerShell interpreter

 

/SExecute a string (like @PSHELL)