PowerShell PowerShell.exe Command-Line


-Help | -? | /?Shows the help
-File <FilePath> [<Args>]Path to script-file that should be executed and arguments (optional)
-Command { - | <script-block> [-args <arg-array>] | <string> [<CommandParameters>] }Commands to be executed followed by arguments
-EncodedCommand <Base64EncodedCommand>Base64 encoded commands
-ExecutionPolicy <ExecutionPolicy>Sets the execution policy for this process only
-InputFormat { Text | XML}Sets input format for data sent to process. Text (strings) or XML (serialized CLIXML)
-MtaPowerShell 3.0+: Runs PowerShell in multi-threaded apartment (STA is default)
-StaPowerShell 2.0: Runs PowerShell in a single-threaded apartment (MTA is default)
-NoExitLeaves PowerShell console running after executing the script/command
-NoLogoHides copyright-banner at launch
-NonInteractiveHides console from user
-NoProfileAvoid loading of PowerShell profiles for machine or user
-OutputFormat { Text | XML }Sets output format for data returned from PowerShell. Text (strings) or XML (serialized CLIXML)
-PSConsoleFile <FilePath>Loads a pre-created console file that configures the environment (created using Export-Console)
-Version <Windows PowerShell version>Specify a version of PowerShell to run. Mostly used with 2.0
-WindowStyle <style>Specifies whether to start the PowerShell process as a normal, hidden, minimized or maximized window.