Skip to content

PowerShell | Fundamentals #1

This is the start of PowerShell fundamentals series, which will contain some basic information and cmdlets. I’ll split this into several post’s, because I don’t want it to be a huge one pager. Also I cannot write all information about this topic down within one day. So have fun reading.

Windows PowerShell and PowerShell Core/7

Windows PowerShell:
- Windows builtin (from MS Server 2008 and Windows 7), based on >= .NET Framework 4.5
- Current Version is 5.1
- Maintained through Windows Updates
- PowerShell.exe

PowerShell:
- Platform Independent
- Based on .NET Framework Core
- Constant further development
- Current Version 7.3 (10.02.23)
- Open Source PowerShell on Github
- pwsh.exe
- The previous name of PowerShell was PowerShell Core. It was originally developed to manage remote nano-servers. As the development of the nano-servers stopped PowerShell Core development continued as independent project and became PowerShell.

Get PowerShell

Due PowerShell is a portable app, it can installed several times. It’s also possible to install PowerShell in USB-Sticks. PowerShell is platform independent, which means you can also install PowerShell in any Linux Distribution such as Ubuntu/Fedaro/Mint/etc. as well as in macOS. Therefore have a look the the official MS documentation: MS Docs I would say the easiest way to get PowerShell is through the Microsoft Store:

post4_1.png

My preferred way to install PowerShell (pwsh) is using winget. Winget is an additional cli based package manager for windows machines. You can use winget to install/upgrade/remove and discover additional applications –> something like apt from linux or homebrew (brew) on macOS.

Get PowerShell 7 using winget:

PowerShell
winget search microsoft.PowerShell
#confirm to agree the source agreement terms with 'y'
winget install --id microsoft.PowerShell --source winget

post4_2.png

Congratulation, you installed pwsh! Now you can start pwsh and check the version:

PowerShell
$psversiontable

Get the location where pwsh is installed (within the pwsh console):

PowerShell
[environment]::commandline

That’s it, Part #1 Fundamentals done.

Cheers!