I have this script so I can install applications that are available in SCCM with Powershell.
I'm trying to do it with a package, but can not make it work. Is there anybody who can help make the script so it works for packages. Thanks
$ComputerName = $env:COMPUTERNAME
$ApplicationName = "VLC Player"
$ApplicationClass = [WmiClass]"\\$($ComputerName)\root\ccm\clientSDK:CCM_Application"
$Application = Get-WmiObject -Namespace "root\ccm\clientSDK" -Class CCM_Program | Where-Object { $_.Name -like "*$($ApplicationName)*" }
$ApplicationID = $Application.Id
$ApplicationRevision = $Application.Revision
$ApplicationClass.Install($ApplicationID,$ApplicationRevision,$false,0,"High",$false)