Powershell-SCCM应用程序安装
我有一个脚本来安装特定的应用程序,但是有没有办法修改脚本来安装所需的缺少的应用程序(更新)Powershell-SCCM应用程序安装,powershell,Powershell,我有一个脚本来安装特定的应用程序,但是有没有办法修改脚本来安装所需的缺少的应用程序(更新) $ComputerName = "ComputerName" $AppName = "AnyConnect Client" $s = New-PSSession -ComputerName $ComputerName Invoke-Command -Session $s -Argu $ComputerName,$AppName -ScriptBlock ` { pa
$ComputerName = "ComputerName"
$AppName = "AnyConnect Client"
$s = New-PSSession -ComputerName $ComputerName
Invoke-Command -Session $s -Argu $ComputerName,$AppName -ScriptBlock `
{
param ($ComputerName,$AppName)
write-host "Getting Parameters for '$AppName' on $ComputerName"
$Application = Get-WmiObject -computername $ComputerName -Namespace "root\ccm\ClientSDK" -Class CCM_Application | where {$_.Name -like "$AppName"} | Select-Object Id, Revision, IsMachineTarget
$AppID = $Application.Id
$AppRev = $Application.Revision
$AppTarget = $Application.IsMachineTarget
([wmiclass]'ROOT\ccm\ClientSdk:CCM_Application').Install($AppID, $AppRev, $AppTarget, 0, 'Normal', $False) | Out-Null
}
Remove-PSSession $s
您是指软件中心中挂起的更新吗?