Skip to content

Instantly share code, notes, and snippets.

View jwmoss's full-sized avatar
🤩
Stuck in a foreach loop

Jonathan Moss jwmoss

🤩
Stuck in a foreach loop
  • Wilmington, NC
View GitHub Profile
#Requires -RunAsAdministrator
#Adapted from https://blogs.technet.microsoft.com/drew/2016/12/23/installing-remote-server-admin-tools-rsat-via-powershell/
$web = Invoke-WebRequest https://www.microsoft.com/en-us/download/confirmation.aspx?id=45520 -UseBasicParsing
$MachineOS = (Get-WmiObject Win32_OperatingSystem).Name
#Check for Windows Server 2012 R2
IF ($MachineOS -like "*Microsoft Windows Server*") {