Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Windows Server » How to update PowerShell and Package Management via Group Policy Object
  • Fix Boot Failed UEFI SCSI Device on HyperV
    How to Fix Boot Failed UEFI SCSI Device on HyperV Virtualization
  • How to Enable and use Sudo in Windows 11
    How to Enable and use Sudo in Windows 11 Windows
  • Azure backup for MSSQL
    Restore MSSQL Server on Azure VMs using Azure Backup Network | Monitoring
  • ePO PIA Tool
    Fixes to Trellix ePolicy Orchestrator Installation Errors Security | Vulnerability Scans and Assessment
  • RDS Error
    RDP Users are unable to change Passwords Windows Server
  • adobeacrobat reader
    Workaround for there were no pages selected to print or the documents could not be printed from Adobe Acrobat Reader JIRA|Confluence|Apps
  • Featured image 2
    How to delete Windows old folder in Windows 11 Windows
  • screenshot 2020 03 07 at 22.25.21
    How to configure the FrontFace Lockdown Tool Windows

How to update PowerShell and Package Management via Group Policy Object

Posted on 22/05/202022/09/2023 Christian By Christian No Comments on How to update PowerShell and Package Management via Group Policy Object
update

The PowerShell announced PowerShell 7 on March 4th, 2020. PowerShell 7 is built on .NET Core 3 and brings many unique APIs required by modules built on .NET Framework in order for them to work with .NET Core runtime. While PowerShell Core 6 was focusing on bringing cross-platform compatibility, is the latest major update to PowerShell, a cross-platform (Windows, Linux, and macOS) automation tool and configuration framework optimized for dealing with structured data and its focus is on making it a viable replacement for Windows PowerShell 5.1 and bringing near parity with Windows PowerShell.  You may want to see the following articles as well. Why use RSAT? How to Install RSAT on Windows 10, Remote Server Administration Tools: To install RSAT on Windows Server, and what is Group Policy Object and how can it be launched in Windows.

Here is how you can install and update PowerShell 7 via GPO. Also for other articles relating to GPO, please see the following link

Here is how you can install and update PowerShell 7 via GPO. Also for other articles relating to GPO, please see the following link

As you can see from the above link, manually installing PowerShell 7 is a hurdle and must be automated if it must be used across the organization. To role this out, a Computer-Based policy needed your goal is to deploy PowerShell 7 to the computer regardless of the user interaction.

Follow the steps below to implement PowerShell version 7 via GPO.
– The PowerShell .MSI file can be downloaded from here.
– Launch the Group Policy Management Console as shown below

PowerShell

This will open up the Group Policy Management console as shown below. I prefer creating a new GPO before linking it to the domain or OU.
– Right Click on the Group Policy Object as shown below and
– Select New GPO
– Enter a name and click on ok

Note: You can on the fly create a GPO in the Domain, OU, and link it right there.
– Either way you chose to go, you will achieve the same result!

Package Management

Next, right-click on the the newly created Group Policy Object as shown below
– Click on Edit

Note: If you're sitting in front of a Windows computer right now, Local Group Policy can be accessed by 
- Clicking  on Start
- Launch the Run dialog box, 
- Typing GPEDIT.MSC, and 
- Pressing Enter:
Group Policy Object

This will open up the console “Group Policy Management Editor” as shown below.

Since we are interested in the computer side configuration, we will be expanding the Computer configuration
– Click on Software Settings
– Right-click Software Installation
– Select select New
– Package

update

In the dialog box, add the full path or the (UNC) to the MSI file. In my case, here is the path C:\Users\Administrator\Downloads since this is being deployed in a lab environment.
– Note: In a production environment, it will advisable to place this MSI file in a shared folder that other users (computers) can access these files.

PowerShell

Select the right MSI file, in my case, it is PowerShell 7
– Click on open as shown below

Package Management

Since, I am using a local path, behold the warning below
– For me, I will click on Yes,

Group Policy Object

– Click on Assigned as shown below and
– Click on Ok

update

Close the Group Policy Management Console as shown below

Next, attach the GPO to your desired OU or Domain. I will li k this to my Domain as shown below. There are two ways to have this done.
1: Drag and drop the Power “GPO” to the Domain or use my preferred method below
2: Right-click on the Domain or OU of your choice and click on “Link an Existing GPO”

This will prompt you with the Select GPO window as shown below
– Click on OK

Now the GPO is linked to the Domain as shown below

By default, these updates are applied every 90 minutes. To us, this is like forever, and we want these policies to be applied immediately. In this case, the GPUpdate command can be used to achieve this. For more information on this, see the following link. In this way, other computers in the Domain will get this update.

If you’d like to spot check specific servers, the below command will come in handy. It reaches out to a remote computer ($computer) and checks the version of PowerShell installed on that computer with $PSVersionTable.PSVersion.

PS> Invoke-Command  -Computername $computer -Scriptblock {$PSVersionTable.psversion}

If you find any computers that don’t have the group policy applied, you can run the following command and it will force group policy to refresh on the target computer.

PS> Invoke-GPUpdate -Computer $computer

To deploy PowerShell 7 with PSRemoting:


Additionally, Windows PowerShell remoting lets you run any Windows PowerShell command on one or more remote computers. Therefore, You can establish persistent connections, start interactive sessions, and run scripts on remote computers. PowerShell remoting is similar to SSH used in accessing remote computers.

Nevertheless, To proceed with this step, ensure that PowerShell remoting is enabled and that you have set up the appropriate permissions for executing remote commands across your environment.  For more information on PSRemoting, visit the following link.
– How to configure servers for remote access (WinRM and PSRemoting), see the following link.

Below is an example of looping through a list of computers stored in the $computers array then running the install-PowerShell.ps1 script on all of them. The idea behind this is similar to what we used here

$creds = $(Get-Credential)
ForEach ($computer in $computers) {
    Invoke-Command -ComputerName $computer -Credential $creds {iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI -Preview -Quiet"}
}

Having updated PowerShell, you will now be able be able to use the latest features, take advantage of the performance enhancements, and even ensure that your older code won’t break on the newer versions.

I hope you found this blog post helpful. If you have any questions, please let me know in the comment session.

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Facebook (Opens in new window) Facebook
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Pocket (Opens in new window) Pocket
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
  • Share on Threads (Opens in new window) Threads
  • Share on Nextdoor (Opens in new window) Nextdoor
Windows Server Tags:GPO, GPOs, Group Policy Management Console, Grouppolicy, PowerShell, PowerShell version 7, PowerShellGet, Windows Server 2016

Post navigation

Previous Post: PowerShell: How to update PowerShellGet and Package Management
Next Post: How to install Winget CLI on Windows

Related Posts

  • IIS8
    How to add an account to the local IIS_IUSRS group Windows Server
  • Fixed drives not encrypted by BitLocker via MBAM
    Why is BitLocker unable to encrypt Removable Drives via MBAM? Windows
  • system
    How to fix the system cannot find the file specified when adding LP, LIP, and FoD packages to Windows Images Windows Server
  • maxresdefault
    The following errors occurred attempting to join the domain: The specified domain either does not exist or could not be contacted Windows Server
  • MBAM Replacement
    MBAM extended support ends April 2026: Find alternative solution Security | Vulnerability Scans and Assessment
  • screenshot 2020 03 31 at 22.22.43
    How to create, edit and delete a scheduled task via the Command Prompt Windows Server

More Related Articles

IIS8 How to add an account to the local IIS_IUSRS group Windows Server
Fixed drives not encrypted by BitLocker via MBAM Why is BitLocker unable to encrypt Removable Drives via MBAM? Windows
system How to fix the system cannot find the file specified when adding LP, LIP, and FoD packages to Windows Images Windows Server
maxresdefault The following errors occurred attempting to join the domain: The specified domain either does not exist or could not be contacted Windows Server
MBAM Replacement MBAM extended support ends April 2026: Find alternative solution Security | Vulnerability Scans and Assessment
screenshot 2020 03 31 at 22.22.43 How to create, edit and delete a scheduled task via the Command Prompt Windows Server

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • Fix Boot Failed UEFI SCSI Device on HyperV
    How to Fix Boot Failed UEFI SCSI Device on HyperV Virtualization
  • How to Enable and use Sudo in Windows 11
    How to Enable and use Sudo in Windows 11 Windows
  • Azure backup for MSSQL
    Restore MSSQL Server on Azure VMs using Azure Backup Network | Monitoring
  • ePO PIA Tool
    Fixes to Trellix ePolicy Orchestrator Installation Errors Security | Vulnerability Scans and Assessment
  • RDS Error
    RDP Users are unable to change Passwords Windows Server
  • adobeacrobat reader
    Workaround for there were no pages selected to print or the documents could not be printed from Adobe Acrobat Reader JIRA|Confluence|Apps
  • Featured image 2
    How to delete Windows old folder in Windows 11 Windows
  • screenshot 2020 03 07 at 22.25.21
    How to configure the FrontFace Lockdown Tool Windows

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,836 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

Active Directory AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.