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
- Desktop
- Core
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
PSVersion 7.4.3
PSEdition Core
GitCommitId 7.4.3
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Installation Methods
- Winget (Recommended)
- MSI Installer
- .NET Global Tool
- Other Platforms
winget search Microsoft.PowerShell
winget install --id Microsoft.Powershell --source winget
For MSI installation, visit the GitHub Page for downloads.
Install PowerShell as a .NET Global tool if you have the .NET Core SDK:
dotnet tool install --global PowerShell
For Linux and macOS, refer to the installation guides:
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:\>_