Skip to main content

Command-line shell and scripting language designed especially for system administration.

:: To start an interactive shell session:
powershell

:: To start an interactive shell session without loading startup configs:
powershell -NoProfile

:: To execute specific commands:
powershell -Command "<echo 'powershell is executed'>"

:: To execute a specific script:
powershell -File <path/to/script.ps1>

:: To start a session with a specific version of PowerShell:
powershell -Version <version>

:: To prevent a shell from exit after running startup commands:
powershell -NoExit

:: To describe the format of data sent to PowerShell:
powershell -InputFormat <Text|XML>

:: To determine how an output from PowerShell is formatted:
powershell -OutputFormat <Text|XML>

:: ---

:: To run a PowerShell script/file in non-interactive mode (e.g. no prompting for missing values):
powershell -NonInteractive -NoProfile -NoLogo -ExecutionPolicy ByPass -File <file.ps1>