Public/Get-CCMClientSoftwareUpdate.ps1
function Get-CCMClientSoftwareUpdate { [cmdletbinding()] param ( [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'ComputerName', Position = 0, Mandatory = $true)] [alias('Name')] [string[]]$ComputerName, [Parameter(ParameterSetName = 'CimSession')] [CimSession[]]$CimSession ) begin { $cimParam = @{ NameSpace = 'root/ccm/ClientSDK' ClassName = 'CCM_SoftwareUpdate' } } process { Switch ($PSCmdlet.ParameterSetName) { 'ComputerName' { $cimParam['ComputerName'] = $ComputerName } 'CimSession' { $cimParam['CimSession'] = $CimSession } } Get-CimInstance @cimParam } end {} } |