Skip to content

Commit 806028c

Browse files
Import offline driver catalog in OSDCloud.DriverPack.ps1
1 parent 6ac072b commit 806028c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Public/OSDCloudDriverPack/OSDCloud.DriverPack.ps1

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,17 @@ function Get-OSDCloudDriverPacks {
6767
#>
6868
[CmdletBinding()]
6969
param ()
70-
$Results = Import-Clixml -Path "$(Get-OSDModulePath)\cache\driverpack-catalogs\build-driverpacks.xml"
70+
$DriverCatalogXML = Get-PSDrive -PSProvider FileSystem | Where-Object {$_.Name -ne 'C'} | ForEach-Object {
71+
Get-ChildItem "$($_.Root)OSDCloud\Catalogs" -Include "build-driverpacks.xml" -File -Force -Recurse -ErrorAction Ignore
72+
}
73+
if ($DriverCatalogXML) {
74+
foreach ($Item in $DriverCatalogXML) {
75+
Write-Warning "$($Item.FullName) is imported instead of the cache under $(Get-OSDModulePath)."
76+
$Results = Import-Clixml -Path $Item.FullName
77+
}
78+
} else {
79+
$Results = Import-Clixml -Path "$(Get-OSDModulePath)\cache\driverpack-catalogs\build-driverpacks.xml"
80+
}
7181
$Results
7282
}
7383
function Save-OSDCloudDriverPack {

0 commit comments

Comments
 (0)