File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,19 @@ function Get-OSDCloudOperatingSystemsIndexMap {
21
21
$OSArch = ' x64'
22
22
)
23
23
24
- $indexMapPath = " $ ( Get-OSDModulePath ) \cache\archive-cloudoperatingindexmap\CloudOperatingIndexMap.json"
25
- $Results = Get-Content - Path $indexMapPath | ConvertFrom-Json
24
+ $OfflineCatalog = Get-PSDrive - PSProvider FileSystem | Where-Object {$_.Name -ne ' C' } | ForEach-Object {
25
+ Get-ChildItem " $ ( $_.Root ) OSDCloud\Catalogs" - Include " CloudOperatingIndexMap.json" - File - Force - Recurse - ErrorAction Ignore
26
+ }
27
+ if ($OfflineCatalog ) {
28
+ foreach ($Item in $OfflineCatalog ) {
29
+ Write-Warning " $ ( $Item.FullName ) is imported instead of the cache under $ ( Get-OSDModulePath ) ."
30
+ $indexMapPath = (Get-Item - Path " $ ( $Item.FullName ) " ).FullName
31
+ }
32
+ } else {
33
+ $indexMapPath = " $ ( Get-OSDCachePath ) \archive-cloudoperatingindexmap\CloudOperatingIndexMap.json"
34
+ }
35
+ $Results = Get-Content - Path $indexMapPath - Encoding UTF8 | ConvertFrom-Json # as of OSD 25.6.10.1 encoding of the json is UTF8
26
36
$Results = $Results | Where-Object { $_.Architecture -eq $OSArch }
27
37
28
38
return $Results
29
- }
39
+ }
You can’t perform that action at this time.
0 commit comments