Created
June 16, 2013 11:30
-
-
Save janegilring/5791780 to your computer and use it in GitHub Desktop.
Sample PowerShell functions for working with the ROOT\ccm\ClientSDK WMI namespace. For more info, see the related article on blog.powershell.no.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-CMMissingUpdate { | |
param ( | |
$computer = "localhost" | |
) | |
Get-WmiObject -Query "SELECT * FROM CCM_SoftwareUpdate" -Namespace "ROOT\ccm\ClientSDK" -ComputerName $computer | |
} | |
function Install-CMMissingUpdate { | |
param ( | |
$computer = "localhost" | |
) | |
([wmiclass]'ROOT\ccm\ClientSDK:CCM_SoftwareUpdatesManager').InstallUpdates([System.Management.ManagementObject[]] ( | |
Get-WmiObject -Query 'SELECT * FROM CCM_SoftwareUpdate' -namespace 'ROOT\ccm\ClientSDK')) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment