wingetautoupdate/Winget-AutoUpdate/functions/Get-StoreApps.ps1

15 lines
381 B
PowerShell
Raw Normal View History

2023-10-09 22:03:10 +00:00
#Function to force an upgrade of Store Apps
Function Get-StoreApps {
try {
$namespaceName = "root\cimv2\mdm\dmmap"
$className = "MDM_EnterpriseModernAppManagement_AppManagement01"
$wmiObj = Get-WmiObject -Namespace $namespaceName -Class $className
$wmiObj.UpdateScanMethod()
return $true
}
catch {
return $false
}
}