How To Check The Os Version In Windows
In this article, nosotros will show how to update your Windows PowerShell version to the latest 5.1 and install (upgrade to) PowerShell Core seven.one. In the previous article, we told that there are currently two versions of PowerShell: a classic Windows PowerShell (the latest version is v.1 and information technology is no longer developed) and a new PowerShell Core platform (version 7.1 is available at present). Despite that the PowerShell version numbering goes on from 5.i (six.0, 6.1, seven.0, 7.1, etc.), these are two different platforms. Then, nosotros'll show how to update both Windows PowerShell and PowerShell Core.
Contents:
- Upgrading to Windows PowerShell v.ane
- How to Install or Update to PowerShell Core vii?
- Installing PowerShell Cadre via Microsoft Store
- Deploying PowerShell Cadre with Group Policy
- Updating PowerShell Remotely
Upgrading to Windows PowerShell 5.1
PowerShell four.0 is installed by default on Windows Server 2012 R2 (Windows eight.i). Let's try to update the Windows PowerShell version to 5.one on Windows Server 2012 R2.
Beginning of all, check the current PowerShell version (the screenshot shows PowerShell iv.0 is installed):
$PSVersionTable.PSVersion

To upgrade your PowerShell version to 5.1, install the Windows Management Framework 5.one, which requires the .Internet Framework four.5.ii (or newer). Make sure that .NET 4.5.2 or higher is installed using this command:
(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Cyberspace Framework Setup\NDP\v4\Full' -Proper noun Release).Release

In my case, the release version 378675 means that .NET Framework version 4.5.1 is installed. And so, I have to download and install the latest .Internet Framework 4.8 (hither is the link to the offline installer: https://go.microsoft.com/fwlink/?linkid=2088631 — ndp48-x86-x64-allos-enu.exe).
Install the .NET 4.eight (you will have to reboot your computer):

If you install WMF five.one without .NET 4.5.2, some PowerShell features will not exist bachelor.
Download WMF 5.1 for Windows Server 2012 R2 — Win8.1AndW2K12R2-KB3191564-x64.msu (https://go.microsoft.com/fwlink/?linkid=839516).
Install the Windows Management Framework 5.i MSU file.

After the server restart, open the PS console and make sure that the PowerShell version has been updated to v.1.

If you have unsupported Windows 7 or Windows Server 2008 R2, y'all can upgrade the PowerShell version from 2.0 to 5.1 in the aforementioned way. Showtime, install .Internet Framework iv.v.2 (or newer), then WMF 5.1 (the download links will be different from those for Windows Server 2012 R2).
How to Install or Update to PowerShell Core 7?
Annotation that the latest Windows PowerShell version installed in Windows 10 and Windows Server 2019 is PowerShell 5.1. Microsoft started to develop a cross-platform PowerShell Core version instead. Currently, PowerShell Cadre vi.0, 6.1, six.2, vii.0 and 7.1 are bachelor. PowerShell Core is substantially a new platform that is installed on the reckoner along with Windows PowerShell. It ways that you cannot upgrade PowerShell five.1 to PowerShell Core 7.i. PowerShell seven is installed on a computer separately from Windows PowerShell 5.one.
In PowerShell 7.1, the developers added maximum compatibility with Windows PowerShell. So, you tin can easily run your quondam PS1 scripts and cmdlets in PowerShell Core.
If you lot have PowerShell Core 6.0 installed, you can update the PowerShell version on your computer to the latest PowerShell 7.1 Core (or you can install PowerShell Core vii.1 together with Windows PowerShell five.1). In this example, nosotros will endeavor to update PowerShell Core in Windows 10 20H2. In that location are two means to upgrade:
- Yous can download the PowerShell Cadre MSI installer manually from GitHub;
- You tin can download and install (update) information technology direct from the PowerShell console.
The latest releases of PowerShell Cadre can be installed on all versions of Windows starting with Windows seven SP1, Server 2008 R2, and newer.
If you want to install PowerShell Cadre using the MSI package, go to the projection folio https://github.com/PowerShell/PowerShell, observe the latest stable release. At the time of this writing, this is the March 4, 2021 release of PowerShell v7.ane.3. The higher preview Release of PowerShell v7.2.0 is also bachelor, but y'all'd better wait for a more stable version. Expand the Assets list and find a parcel for your Windows version (PowerShell-7.i.3-win-x64.msi or PowerShell-7.1.3-win-x86.msi).

Download the MSI file and install it.

To install PowerShell Core from an MSI packet using SCCM/MDT/scripts in quiet manner, you can use a command with the following parameters:
msiexec.exe /packet PowerShell-7.1.0-win-x86.msi /quiet ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 ENABLE_PSREMOTING=1 REGISTER_MANIFEST=one
You tin update the PowerShell right from the PS cli.
Allow'southward update (install) the latest PowerShell Core version using the command:
iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI"
This command downloads the PowerShell vii.i MSI distribution file from GitHub and then starts the installation via the MSI installer.
Yous can as well use other installation parameters:
- -Destination – change the default PowerShell Core installation folder
- -Preview – install the latest Preview PowerShell version
- -Tranquillity – a placidity installation mode
- -AddToPath – adds a path to the PowerShell Cadre installation directory to the environment variables

After the installation is finished, the PowerShell Core (pwsh.exe) window appears. Check the PowerShell version hither to make sure it is PoSh 7.1.3.

If you take the WinGet package manager installed, you tin install or update your PowerShell version to the latest command:
winget install --id=Microsoft.PowerShell -e
Or, y'all tin install a specific version of PowerShell Cadre:
winget install --id=Microsoft.PowerShell -5 "7.one.2" -e
If you accept Chocolatey package director installed, utilize the commands:
choco install powershell -y
choco upgrade powershell -y
or for PowerShell seven.x:
choco install pwsh -y
choco install pwsh -y
Pay attending to the directories of different PowerShell versions:
- Windows PowerShell 5.1:
$env:WINDIR\System32\WindowsPowerShell\v1.0 - PowerShell Cadre 6.x:
$env:ProgramFiles\PowerShell\6 - PowerShell Core 7.x:
$env:ProgramFiles\PowerShell\seven
If PowerShell 6.ten was installed on your estimator, the $env:ProgramFiles\PowerShell\6 directory is automatically removed when you install PowerShell 7.1.
Note that the name of the PowerShell executable has changed. In PowerShell Core information technology is c:\Programme Files\PowerShell\7\pwsh.exe. It has its own icon in the Start carte du jour.
- To run .Internet Framework-based Windows PowerShell, the
powershell.execommand is used - To run .NET Core-based PowerShell Cadre, use the
pwsh.exe

This means that you lot have both Windows PowerShell 5.1 and PowerShell Cadre 7.one installed on your calculator.

In lodge to find out the version and build of PowerShell installed on your device, you can check the version of the pwsh.exe file:
(Get-Command 'C:\Programme Files\PowerShell\7\pwsh.exe').Version

This is how you tin bank check the version of a file on a remote computer:
Invoke-Command -Computername computer1 -Scriptblock {(Get-Command 'C:\Programme Files\PowerShell\vii\pwsh.exe').Version}
Windows PowerShell provides a special backward compatibility mode that allows yous to run an older version of PowerShell fifty-fifty if you have newer versions installed. Y'all tin beginning PowerShell of a specific version (for example 4.0) with the post-obit control:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Version iv
Installing PowerShell Core via Microsoft Store
On Windows x, you can install or update PowerShell via the Microsoft Store. Yous tin manually find the PowerShell app in the Store or utilise this link. The advantage of this installation method is that the Shop app volition track the installed version of PowerShell and automatically install app updates as they go available.
But there are also disadvantages to the fact that such a PowerShell instance will run in a sandbox.

Deploying PowerShell Core with Group Policy
In the Agile Directory domain, you can centrally deploy and update PowerShell Core using Grouping Policy. Use the GPO's features to install MSI packages.
- Download the PowerShell MSI installation file and copy information technology to the SYSVOL directory on the domain controller;
- Open the Domain Group Policy Management Panel (
gpmc.msc), create a new GPO and link it to the OU with computers and servers; - Go to the GPO section Estimator Configuration -> Software Settings, create a new package, and specify the path to the PowerShell MSI installation file in the SYSVOL folder in the domain (apply the UNC path);
You tin can use the GPO WMI filters to more than accurately target your policy to domain devices.
- To update the software installation Group Policy settings, you need to restart the computers. The new version of PowerShell volition exist installed on all computers at startup.
Updating PowerShell Remotely
Y'all can use i of the following methods to update PowerShell on remote computers via the command prompt.
The first method allows yous to remotely update PowerShell on the estimator using the MSI installer in the shared network folder:
Invoke-Command -ComputerName mun-srv01 -ScriptBlock {Commencement-Process msiexec.exe -ArgumentList '/packet "\\mun-fs01\install\PowerShell-seven.i.3-win-x64.msi" /tranquility ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 ENABLE_PSREMOTING=1 REGISTER_MANIFEST=1' -Expect}
The following script volition select all active Windows 10 computers from the Active Directory domain and start downloading and installing PowerShell Core on each of them:
$ADComputers = Get-ADComputer -Filter 'operatingsystem -like "*Windows 10*" -and enabled -eq "true"'
ForEach ($computer in $ADcomputers) {
Invoke-Command -ComputerName $computer {iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI -Quiet"}
}
Exist conscientious when using the PowerShell Remoting commands when connecting to remote computers (with the Enter-PSSession and Invoke-Command cmdlets). If you need to connect to a PowerShell vii.1 endpoint, you need to utilize the command:
Enter-PSSession -ComputerName dc01 -ConfigurationName "powershell.7.ane.3"
Otherwise, you will connect to the PowerShell Remoting 5.i endpoint.
Source: http://woshub.com/install-update-powershell-windows/
Posted by: overcashsheastes.blogspot.com

0 Response to "How To Check The Os Version In Windows"
Post a Comment