File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -19,10 +19,30 @@ function Get-OSDCloudOperatingSystemsIndexes {
1919 )
2020
2121 if ($OSArch -eq ' x64' ) {
22- $Results = Get-Content - Path " $ ( Get-OSDModulePath ) \cache\archive-cloudoperatingsystems\CloudOperatingSystemsIndexes.json" | ConvertFrom-Json
22+ $OfflineCatalog = Get-PSDrive - PSProvider FileSystem | Where-Object {$_.Name -ne ' C' } | ForEach-Object {
23+ Get-ChildItem " $ ( $_.Root ) OSDCloud\Catalogs" - Include " CloudOperatingSystemsIndexes.json" - File - Force - Recurse - ErrorAction Ignore
24+ }
25+ if ($OfflineCatalog ) {
26+ foreach ($Item in $OfflineCatalog ) {
27+ Write-Warning " $ ( $Item.FullName ) is imported instead of the cache under $ ( Get-OSDModulePath ) ."
28+ $Results = Get-Content - Path " $ ( $Item.FullName ) " | ConvertFrom-Json - ErrorAction " Stop"
29+ }
30+ } else {
31+ $Results = Get-Content - Path " $ ( Get-OSDCachePath ) \archive-cloudoperatingsystems\CloudOperatingSystemsIndexes.json" | ConvertFrom-Json
32+ }
2333 }
2434 elseif ($OSArch -eq " ARM64" ) {
25- $Results = Get-Content - Path " $ ( Get-OSDModulePath ) \cache\archive-cloudoperatingsystems\CloudOperatingSystemsARM64Indexes.json" | ConvertFrom-Json
35+ $OfflineCatalog = Get-PSDrive - PSProvider FileSystem | Where-Object {$_.Name -ne ' C' } | ForEach-Object {
36+ Get-ChildItem " $ ( $_.Root ) OSDCloud\Catalogs" - Include " CloudOperatingSystemsARM64Indexes.json" - File - Force - Recurse - ErrorAction Ignore
37+ }
38+ if ($OfflineCatalog ) {
39+ foreach ($Item in $OfflineCatalog ) {
40+ Write-Warning " $ ( $Item.FullName ) is imported instead of the cache under $ ( Get-OSDModulePath ) ."
41+ $Results = Get-Content - Path " $ ( $Item.FullName ) " | ConvertFrom-Json - ErrorAction " Stop"
42+ }
43+ } else {
44+ $Results = Get-Content - Path " $ ( Get-OSDCachePath ) \archive-cloudoperatingsystems\CloudOperatingSystemsARM64Indexes.json" | ConvertFrom-Json
45+ }
2646 }
2747
2848 return $Results
You can’t perform that action at this time.
0 commit comments