Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Surface Driver Packs (.msi) to be used with Invoke-OSDCloudDriverPackCM/MDT #76

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Public/OSDCloudDriverPack/Invoke-OSDCloudDriverPackCM.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions Public/OSDCloudDriverPack/Invoke-OSDCloudDriverPackMDT.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand All @@ -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"))) {
Expand All @@ -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"

Expand Down