Earlier this month Powershell 7 went GA and it is a new major release 2 years after the previous one. I always think that whenever a new major version is out it is definitely time to install it.
What I generally do and suggest everybody do the same is to look at the new features, at the deprecated ones if any and most importantly to see what’s the impact or implications for the code that I will consider to run on PowerShell core in this case.
The official announcement contains all the information you need so without further ado read it before installing it.
A very interesting method of installing it is by using PowerShell :
1 |
iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI" |
Without aliases:
1 2 3 4 5 6 7 |
#requires -runasadministrator #Paolo Frigo, https://www.scriptinglibrary.com # DOWNLOAD AND INSTALL THE LATEST VERSION OF POWERSHELL # BY USING THE MSI INSTALLER IN UNATTENDED/QUIET MODE. Invoke-Expression "& { $(Invoke-RestMethod https://aka.ms/install-powershell.ps1) } -UseMSI -quiet" |
And of course, you can run this code remotely with invoke-command against one or more endpoints (remember to use –quiet for unattended installations):
1 |
invoke-command -computername YOUR_REMOTE_ENDPOINT - scriptblock {iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI -quiet"} |
As usual, you can find on my GitHub repository these scripts.