File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,18 @@ function Get-OSDCloudOperatingSystems {
1616 [System.String ]
1717 $OSArch = ' x64'
1818 )
19- $FullResults = Get-Content - Path " $ ( Get-OSDModulePath ) \cache\archive-cloudoperatingsystems\CloudOperatingSystems.json" | ConvertFrom-Json
20- if ($OSArch -eq ' x64' ){
21- $Results = $FullResults | Where-Object {$_.Architecture -eq " x64" }
19+ $OfflineCatalog = Get-PSDrive - PSProvider FileSystem | Where-Object {$_.Name -ne ' C' } | ForEach-Object {
20+ Get-ChildItem " $ ( $_.Root ) OSDCloud\Catalogs" - Include " CloudOperatingSystems.json" - File - Force - Recurse - ErrorAction Ignore
2221 }
23- elseif ($OSArch -eq " arm64" ){
24- $Results = Get-Content - Path " $ ( Get-OSDModulePath ) \cache\archive-cloudoperatingsystems\CloudOperatingSystemsARM64.json" | ConvertFrom-Json
22+ if ($OfflineCatalog ) {
23+ foreach ($Item in $OfflineCatalog ) {
24+ Write-Warning " $ ( $Item.FullName ) is imported instead of the cache under $ ( Get-OSDModulePath ) ."
25+ $FullResults = Get-Content - Path " $ ( $Item.FullName ) " | ConvertFrom-Json - ErrorAction " Stop"
26+ }
27+ $Results = $FullResults | Where-Object {$_.Architecture -eq $OSArch }
28+ } else {
29+ $FullResults = Get-Content - Path " $ ( Get-OSDModulePath ) \cache\archive-cloudoperatingsystems\CloudOperatingSystems.json" | ConvertFrom-Json
30+ $Results = $FullResults | Where-Object {$_.Architecture -eq $OSArch }
2531 }
2632 $Results
2733}
You can’t perform that action at this time.
0 commit comments