Skip to main content

PowerShell

Learn about different editions of PowerShell and explore installation methods for various platforms.

Edition

To determine the current version and edition of PowerShell, run either of the following:

$PSVersionTable
$PSVersionTable.PSVersion
$PSVersiontable.Values
PSVersion                      5.1.22621.3810
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22621.3810
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Installation Methods

winget search Microsoft.PowerShell
winget install --id Microsoft.Powershell --source winget
Important

When upgrading PowerShell, use the same installation method as initially used.

Profile Management

$PROFILE | Select-Object *
notepad $PROFILE
Test-Path -Path $PROFILE.AllUsersAllHosts

Custom Script Example

# Example: Customize PowerShell prompt
function Prompt { "mkeithx" + ":\" + "> " }

mkeithx:\>_