How to update Windows Powershell on Windows 8.1 pro
Published: 2019-10-24 14:06:03

The most frustrating problem on the internet is looking for a solution then only getting ones which don't apply to your specific problem, so hey, lets fix that:)

Windows powershell is a command line shell and scripting language mostly used for system administration. It is built on Microsofts .NET Framework. If you're new to the game or have generally never considered Powershell then suddenly some software you want requires the latest version, your first question will probably be "why cant I just use my cmd or git bash?", the answer to this is simple: PowerShell is completely different from the Command Prompt, it has access to tasks cmd does not and I guess the most relevant point is it uses different commands which are called cmdlets. While you can still run git/cmd commands in the powershell (by piping or aliasing) especially if you use Windows 10 which did away with cmd completely in favor of Powershell, running commands vice versa may need a bit more experience and skill.

To run a powershell command or script in your cmd prompt window use: powershell -command "**Insert command between the quotes**", and for scripts: powershell -command "& '**insert path to file here**'"

The default powershell version installed with Windows 8.1 pro is 4.0.

Now down to basics, how to upgrade to the latest stable version (right now its 5.1).

1: I suggest you first run '$PSVersionTable' or 'Get-Host | Select-Object Version' in your powershell window. This just checks and makes sure you have a lower version than the one you wish to upgrade to. The version will usually be the first entry displayed in the table.

![version check](https://thepracticaldev.s3.amazonaws.com/i/tmg4dzql485u6goom6ih.PNG)


2: Now that you know you really need an update, visit the [Windows download page](https://www.microsoft.com/en-us/download/details.aspx?id=54616) and click on Download.

3: The versions might be confusing so here's some help, if you are running a 64 bit machine then tick the box with x64.msu, if you're running a 32 bit machine then tick x86.msu and proceed to download. 

![download page](https://thepracticaldev.s3.amazonaws.com/i/plgl2yd9i8qi8ydjiw7b.PNG)

4: After this its just a matter of running the .msu file and following the prompts.

**Please Note:**
It's always best to select 'run as administrator'.
Your changes will not be applied until you restart so don't skip this step.

5: After your restart when you press the windows key and type 'powershell' it might no longer appear in the start menu, simply find its new location and pin it to the menu. My (and I believe most) powershell shortcut was located in: 
"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools".
 Scroll down to the latest update (you can use the 'date modified' as a guideline) then right click and choose pin to start.

6: An optional step is to default it to start with administrative privileges, follow the steps in 5 then right click and choose properties->advanced->run as administrator->okay->apply

![optional step](https://thepracticaldev.s3.amazonaws.com/i/37iqp6xbws2so37c2i6l.PNG)

There you go, a fully upgraded Windows Powershell is now ready for your bidding. Happy hunting!