Updating PowerShell via Windows Update or WSUS The most common way to update the PowerShell Core on Linux distros is to use the native package manager. Otherwise, you will connect to the PowerShell Remoting 5.1 endpoint. If you need to connect to a PowerShell 7 endpoint, you must use the command:Įnter-PSSession -ComputerName dc01 -ConfigurationName "powershell.7" ![]() Take care when using PowerShell Remoting commands when connecting to remote computers (with the Enter-PSSession and Invoke-Command cmdlets). Invoke-Command -Computername computer1 -Scriptblock This is how you can check the version of a file on a remote computer: ![]() (Get-Command 'C:\Program Files\PowerShell\7\pwsh.exe').Version To find the version and build of PowerShell that is installed on your device, you can check the version of the pwsh.exe file: If you have the Chocolatey package manager installed, use the commands (for 5.1): Winget install -id=Microsoft.PowerShell -v "7.1.2" -e Or, you can install a specific version of PowerShell Core: Winget install -id Microsoft.Powershell -source winget If you have the WinGet package manager installed, you can install or update your PowerShell version to the latest command: Using WinGet Package Manager to Install or Update PowerShell Core Check the PowerShell version to ensure that it is updated to PoSh 7.3.3. When the installation is complete, the PowerShell Core (pwsh.exe) window appears. This command downloads the PowerShell 7.3 MSI file from GitHub and then starts the installation via the MSI installer. To install or upgrade to the latest version of PowerShell Core, run the following command: You can upgrade PowerShell directly from the console. Msiexec.exe /package PowerShell-7.3.3-win-圆4.msi /quiet ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 ENABLE_PSREMOTING=1 REGISTER_MANIFEST=1 ADD_PATH=1 ENABLE_MU=1 ADD_PATH=1 ENABLE_MU – allow the PowerShell Core to be updated through Windows Updateįor example, the command for a silent installation might look something like this:.USE_MU – use the Microsoft Update to get PSCore updates.ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL.To install PowerShell Core from an MSI package using SCCM/MDT/scripts in quiet mode, you can use a command with the following parameters: The following installation options are available: ![]() Use only stable or LTS releases for a production environment. At the time of writing, the most recent release of PowerShell is v7.3.3, dated 24 February 2023 (for example, PowerShell-7.3.3-win-圆4.msi or PowerShell-7.3.3-win-x86.msi). If you want to install PowerShell Core using the MSI package, go to the project page and download the installation package for your OS version. ![]() Upgrading the PowerShell Core Using MSI installation Next, using the example of updating PowerShell Core to 7.3 on Windows 10 22H2, we will look at all of these methods.
0 Comments
Leave a Reply. |