How to install PowerShell 5 on Windows 7

Have older Windows systems on your network? You can give them PowerShell 5's event logging capabilities even if they run Windows 7.

You might think that something as basic as PowerShell, Microsoft’s a task automation and configuration management framework, shouldn’t need to be updated. After all, it comes with the operating system, right? However, Windows 7 has hardly any ability to log PowerShell, whereas Windows 10’s version of PowerShell has much more robust logging.

What if you aren’t quite ready to roll out Windows 10 network-wide? All is not lost. You can update to PowerShell 5 on Windows 7, and in fact it’s recommended to do so to add suspicious-script block-logging that is not in the PowerShell shipped on Windows 7.

To install PowerShell 5 on Windows 7, there are a few mandatory prerequisites:

  1. Install Windows Management Framework 4.0.
  2. Install .NET 4.5 on Windows 7.
  3. With the first two steps done, you can install Windows Management Framework 5.1. Once this is in place, you can use the abilities of PowerShell 5 on Windows 7 and turn on the enhanced logging that 5 provides.

Next enable logging through Group Policy by configuring it as follows:

Go to Administrative Templates, then Windows Components and then Windows PowerShell. There you will make a few settings.

bradley powershell 1 Microsoft

Add PowerShell Script Block loggin

The first, “Turn on Module logging”, records portions of scripts and de-obfuscated code, and will log events to event ID 4103 in the Windows PowerShell log. You’ll want to determine what modules you want to track. To obtain a list of modules, use the Get-Module -ListAvailable PowerShell cmdlet and then add the modules you want to audit. Alternatively, you can enter * to log all modules. Use the wild card to initially set up logging.

To continue reading this article register now

Get the best of CSO ... delivered. Sign up for our FREE email newsletters!