Private/osdcloud-steps/Step-OSDCloudWinpeDriverPackSurface.ps1
function Step-OSDCloudWinpeDriverPackSurface { [CmdletBinding()] param ( [System.IO.FileInfo]$FileInfo ) #================================================= # Start the step $Message = "[$(Get-Date -format G)] [$($MyInvocation.MyCommand.Name)] Start" Write-Debug -Message $Message; Write-Verbose -Message $Message #================================================= $ExpandPath = 'C:\Windows\Temp\osdcloud\drivers-driverpack' if (-not (Test-Path "$ExpandPath")) { New-Item $ExpandPath -ItemType Directory -Force -ErrorAction Ignore | Out-Null } $ScriptsPath = "C:\Windows\Setup\Scripts" if (-not (Test-Path $ScriptsPath)) { New-Item -Path $ScriptsPath -ItemType Directory -Force -ErrorAction Ignore | Out-Null } $LogPath = "C:\Windows\Temp\osdcloud-logs" if (-not (Test-Path -Path $LogPath)) { New-Item -ItemType Directory -Path $LogPath -Force | Out-Null } $SetupCompleteCmd = "$ScriptsPath\SetupComplete.cmd" $SetupSpecializeCmd = "C:\Windows\Temp\osdcloud\SetupSpecialize.cmd" #================================================= Write-Host -ForegroundColor DarkGray "[$(Get-Date -format G)] [$($MyInvocation.MyCommand.Name)] Adding Microsoft Surface DriverPack to $SetupCompleteCmd" $Content = @" :: ======================================================== :: OSDCloud DriverPack Installation for Microsoft Surface :: ======================================================== msiexec /i $($FileInfo.FullName) /qn /norestart /l*v $LogPath\drivers-driverpack-microsoft.log rd /s /q C:\Drivers rd /s /q $ExpandPath rd /s /q C:\Windows\Temp\osdcloud\drivers-driverpack-download :: ======================================================== "@ $Content | Out-File -FilePath $SetupCompleteCmd -Append -Encoding ascii -Width 2000 -Force #================================================= # End the function $Message = "[$(Get-Date -format G)] [$($MyInvocation.MyCommand.Name)] End" Write-Verbose -Message $Message; Write-Debug -Message $Message #================================================= } |