LinuxCommandLibrary

pwsh

TLDR

Start PowerShell

$ pwsh
copy
Execute command
$ pwsh -Command "[Get-Process]"
copy
Run script
$ pwsh -File [script.ps1]
copy
Non-interactive mode
$ pwsh -NonInteractive -Command "[command]"
copy
Specific version
$ pwsh -Version
copy

SYNOPSIS

pwsh [options] [file]

DESCRIPTION

pwsh is PowerShell Core. Cross-platform shell and scripting.
The tool runs on Linux/macOS/Windows. Microsoft's modern shell.
pwsh runs PowerShell.

PARAMETERS

FILE

Script file to execute.
-Command CMD
Execute command.
-File FILE
Execute script file.
-NonInteractive
No interactive prompt.
-NoProfile
Don't load profile.
-Version
Show version.

CAVEATS

Requires installation. Different from Windows PowerShell.

HISTORY

PowerShell Core was released by Microsoft as cross-platform shell.

SEE ALSO

bash(1), zsh(1), sh(1)

Copied to clipboard