tabs-not-spaces/Intune.USB.Creator

Typo & Panther folder exists check

devel1988wyc opened this issue · 1 comments

I've Noticed the unatteded file didn't want to copy

  1. folder did not exist.
  2. typo in the looking for unattented.xml

#region Copying over unattended.xml
Write-Host "`nLooking for unattended.xml.." -ForegroundColor Yellow
if (Test-Path "$($usb.winPESource)scripts\unattended.xml" -ErrorAction SilentlyContinue) {
if(-not (Test-Path "$($usb.scRoot)Windows\Panther" -ErrorAction SilentlyContinue)){
New-Item -Path "$($usb.scRoot)Windows\Panther" -ItemType Directory -Force | Out-Null
}
Write-Host "Found it! Copying over to scratch drive.." -ForegroundColor Green
Copy-Item -Path "$($usb.winPESource)\scripts\unattended.xml" -Destination "$($usb.scRoot)Windows\Panther\unattended.xml" | Out-Null
}
else {
Write-Host "Nothing found. Moving on.." -ForegroundColor Red
}
#endregion

Agreed. This is really a bug in the implementation. I updated with the below.
NOTE: "unattend.xml" is the actual file name that is used in normal deployments

#region Copying over unattend.xml
Write-Host "`nLooking for unattend.xml.." -ForegroundColor Yellow
if (Test-Path "$($usb.winPESource)scripts\unattend.xml" -ErrorAction SilentlyContinue) {
Write-Host "Unattend file found! Copying over to scratch drive.." -ForegroundColor Green
New-Item -Type dir "$($usb.scRoot)Windows\Panther" | Out-Null
Copy-Item -Path "$($usb.winPESource)\scripts\unattend.xml" -Destination "$($usb.scRoot)Windows\Panther\unattend.xml" | Out-Null
}
else {
Write-Host "Nothing found." -ForegroundColor Red
}
#endregion