Fork me on GitHub

This page explains how to install Powershell 2.0 on Windows XP SP2.

Official requirements

The official Powershell 2.0 download page lists the following requirements:

WinRM 2.0 and PowerShell 2.0 can be installed on the following supported operating systems:

Windows PowerShell 2.0 requires the Microsoft .NET Framework 2.0 with Service Pack 1.

Workaround

However it is possible to use and install Powershell 2.0 on Windows XP SP2. Simply follow the following steps in order:

  1. Download the Windows Management Framework Core from http://support.microsoft.com/kb/968929 (or the direct download link)
  2. Use 7-zip to extract the content of the EXE file into a folder, for ex: C:\Powershell2.0
  3. Modify the included profile.ps1 file to modify all the default aliases.
    Change
    set-alias cat get-content
    Into
    set-alias cat get-content -options allscope
  4. Create a file called Powershell2.reg with the following content:
    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1]
    "Install"=dword:00000001
    "PID"="89383-100-0001260-04309"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\1033]
    "Install"=dword:00000001

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine]
    "ApplicationBase"="C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0"
    "ConsoleHostAssemblyName"="Microsoft.PowerShell.ConsoleHost,Version=1.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35,ProcessorArchitecture=msil"
    "ConsoleHostModuleName"="\"C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Microsoft.PowerShell.ConsoleHost.dll\""
    "PowerShellVersion"="2.0"
    "PSCompatibleVersion"="1.0,2.0"
    "RuntimeVersion"="v2.0.50727"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell]
    "ExecutionPolicy"="Unrestricted"
    "Path"="C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\powershell.exe"
                                           
  5. Modify this file to reflect the path where you installed Powershell 2.0.
    For example, replace C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0 by C:\\Powershell2.0
  6. Run the Powershell2.reg file to modify the Windows Registry.

How to use it

You should now be able to run Powershell 2.0 from the extracted location.