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:\>_