Skip to content

Instantly share code, notes, and snippets.

@Kaidja
Created December 22, 2017 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kaidja/128dfbcf7deecf6828aee50ca59c7644 to your computer and use it in GitHub Desktop.
Save Kaidja/128dfbcf7deecf6828aee50ca59c7644 to your computer and use it in GitHub Desktop.
Import-Module $env:SMS_ADMIN_UI_PATH.Replace("\bin\i386","\bin\configurationmanager.psd1")
$CMSite = Get-PSProvider -PSProvider CMSITE
Set-Location -Path "$($CMSite.Drives.Name):\"
# 2017 Software Update Groups
#Create new Software Update Group for 2017 Updates
New-CMSoftwareUpdateGroup -Name 'SUM WRK 2017 Compliance'
#Get 2017 Software Updates Groups
$SWGroups = Get-CMSoftwareUpdateGroup -Name 'SUM WRK 2017*' -ForceWildcardHandling |
ForEach-Object {
foreach($Update in $PsItem.Updates){
Add-CMSoftwareUpdateToGroup -SoftwareUpdateId $Update `
-SoftwareUpdateGroupName 'SUM WRK 2017 Compliance'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment