diff --git a/Public/OSDCloudDriverPack/Invoke-OSDCloudDriverPackCM.ps1 b/Public/OSDCloudDriverPack/Invoke-OSDCloudDriverPackCM.ps1 index 6bec4d52..e6da80e7 100644 --- a/Public/OSDCloudDriverPack/Invoke-OSDCloudDriverPackCM.ps1 +++ b/Public/OSDCloudDriverPack/Invoke-OSDCloudDriverPackCM.ps1 @@ -15,7 +15,10 @@ function Invoke-OSDCloudDriverPackCM { [CmdletBinding()] param ( [string]$Manufacturer = (Get-MyComputerManufacturer -Brief), - [string]$Product = (Get-MyComputerProduct) + [string]$Product = (Get-MyComputerProduct), + [System.String] + [ValidateSet('Windows 11','Windows 10')] + $DriverOSVersion = 'Windows 11' ) #================================================= # Make sure we are running in a Task Sequence first @@ -116,7 +119,7 @@ function Invoke-OSDCloudDriverPackCM { Write-Host -ForegroundColor DarkGray "$((Get-Date).ToString('yyyy-MM-dd-HHmmss')) Processing function Get-MyDriverPack" Write-Host if ($Manufacturer -in ('Dell','HP','Lenovo','Microsoft')) { - $GetMyDriverPack = Get-MyDriverPack -Manufacturer $Manufacturer -Product $Product + $GetMyDriverPack = Get-OSDCloudDriverPack -OSVersion $DriverOSVersion -Product $Product } else { $GetMyDriverPack = Get-MyDriverPack -Product $Product @@ -163,7 +166,7 @@ function Invoke-OSDCloudDriverPackCM { Save-WebFile -SourceUrl $GetMyDriverPack.Url -DestinationDirectory $OSDiskDrivers -DestinationName $GetMyDriverPack.FileName } - $ReadyDriverPack = Get-ChildItem -Path $OSDiskDrivers -File -Force -ErrorAction Ignore | Where-Object {$_.Name -match $GetMyDriverPackBaseName} | Where-Object {$_.Extension -in ('.cab','.zip','.exe')} + $ReadyDriverPack = Get-ChildItem -Path $OSDiskDrivers -File -Force -ErrorAction Ignore | Where-Object {$_.Name -match $GetMyDriverPackBaseName} | Where-Object {$_.Extension -in ('.cab','.zip','.exe','.msi')} if ($ReadyDriverPack) { $PPKGMethod = $true Write-Host -ForegroundColor Cyan "$((Get-Date).ToString('yyyy-MM-dd-HHmmss')) DriverPack has been copied to $OSDiskDrivers" diff --git a/Public/OSDCloudDriverPack/Invoke-OSDCloudDriverPackMDT.ps1 b/Public/OSDCloudDriverPack/Invoke-OSDCloudDriverPackMDT.ps1 index f4ae3a20..7345d62b 100644 --- a/Public/OSDCloudDriverPack/Invoke-OSDCloudDriverPackMDT.ps1 +++ b/Public/OSDCloudDriverPack/Invoke-OSDCloudDriverPackMDT.ps1 @@ -104,7 +104,7 @@ function Invoke-OSDCloudDriverPackMDT { $DeployRootDriverPacks = Join-Path $DEPLOYROOT 'DriverPacks' $DeployRootDriverPack = @() - $DeployRootDriverPack = Get-ChildItem $DeployRootDriverPacks -File -Recurse -Force -ErrorAction Ignore | Where-Object {$_.Name -match $GetMyDriverPackBaseName} | Where-Object {$_.Extension -in ('.cab','.zip','.exe')} | Select-Object -First 1 + $DeployRootDriverPack = Get-ChildItem $DeployRootDriverPacks -File -Recurse -Force -ErrorAction Ignore | Where-Object {$_.Name -match $GetMyDriverPackBaseName} | Where-Object {$_.Extension -in ('.cab','.zip','.exe','.msi')} | Select-Object -First 1 if ($DeployRootDriverPack) { Write-Host -ForegroundColor Cyan "$((Get-Date).ToString('yyyy-MM-dd-HHmmss')) Copying existing DriverPack from the MDT DeploymentShare" Write-Host -ForegroundColor DarkGray "-Source $($DeployRootDriverPack.FullName)" @@ -117,7 +117,7 @@ function Invoke-OSDCloudDriverPackMDT { # Get the DriverPack #================================================= if ($GetMyDriverPack) { - $ReadyDriverPack = Get-ChildItem -Path $OSDiskDrivers -File -Force -ErrorAction Ignore | Where-Object {$_.Name -match $GetMyDriverPackBaseName} | Where-Object {$_.Extension -in ('.cab','.zip','.exe')} + $ReadyDriverPack = Get-ChildItem -Path $OSDiskDrivers -File -Force -ErrorAction Ignore | Where-Object {$_.Name -match $GetMyDriverPackBaseName} | Where-Object {$_.Extension -in ('.cab','.zip','.exe','.msi')} if (-Not ($ReadyDriverPack)) { if ((-NOT (Test-Path "$env:SystemRoot\System32\curl.exe")) -and (-NOT (Test-Path "$OSDISK\Windows\System32\curl.exe"))) { @@ -136,7 +136,7 @@ function Invoke-OSDCloudDriverPackMDT { Save-WebFile -SourceUrl $GetMyDriverPack.Url -DestinationDirectory $OSDiskDrivers -DestinationName $GetMyDriverPack.FileName } - $ReadyDriverPack = Get-ChildItem -Path $OSDiskDrivers -File -Force -ErrorAction Ignore | Where-Object {$_.Name -match $GetMyDriverPackBaseName} | Where-Object {$_.Extension -in ('.cab','.zip','.exe')} + $ReadyDriverPack = Get-ChildItem -Path $OSDiskDrivers -File -Force -ErrorAction Ignore | Where-Object {$_.Name -match $GetMyDriverPackBaseName} | Where-Object {$_.Extension -in ('.cab','.zip','.exe','.msi')} if ($ReadyDriverPack) { Write-Host -ForegroundColor Cyan "$((Get-Date).ToString('yyyy-MM-dd-HHmmss')) DriverPack has been copied to $OSDiskDrivers"