fix(sccm): site-status - use default provider (#3084)
This commit is contained in:
parent
39690f35b3
commit
cde4f2b689
|
@ -49,6 +49,13 @@ Try {
|
|||
$returnArray = @()
|
||||
|
||||
$providers = Get-PSProvider | Where {$_.Name -match "CMSite" }
|
||||
if ($null -eq $providers -or $providers.Count -eq 0) {
|
||||
$providers = New-Object System.Collections.Generic.List[Hashtable];
|
||||
$item = @{}
|
||||
$item.Name = "AdminUI.PS.Provider\CMSite"
|
||||
$items.Add($item)
|
||||
}
|
||||
|
||||
foreach ($provider in $providers) {
|
||||
New-PSDrive -Name SCCMDrive -PSProvider $provider.Name -Root $env:COMPUTERNAME -Description "SCCM Site" | Out-Null
|
||||
CD "SCCMDrive:\"
|
||||
|
@ -68,7 +75,7 @@ Try {
|
|||
$returnArray += $returnObject
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$returnArray | ConvertTo-JSON-20 -forceArray $true
|
||||
} Catch {
|
||||
Write-Host $Error[0].Exception
|
||||
|
|
Loading…
Reference in New Issue