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 {
16
16
[System.String ]
17
17
$OSArch = ' x64'
18
18
)
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
22
21
}
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 }
25
31
}
26
32
$Results
27
33
}
You can’t perform that action at this time.
0 commit comments