Injecting AutPilot Configuration file error
Ezmoshow opened this issue · 4 comments
Hey This is great stuff! I really dig this!
Although i had this running at one point successfully (using vanilla ISO from Microsoft), I am now running into a weird issue here unfortunately when using a sysprepped version of a wim file.
I am getting a "Could not find a part of the path 'W:\Windows\Provisioning\Autopilot\AutopilotConfigurationFile.json' when trying to inject the AutoPilot Configuration File...
Error at Line 433 of the invoke-provision.ps1 script...
Any suggestions here?
Thanks!
Just adding... the above still occurs, not sure why, but everythign seems to be working normally despite that ConfigFile.json injection error.
it turns out, Sysprepped images (Win10 1903 and 1909) will remove the Autopilot directory once "generalized"... Any chance we can "inject" that folder back in (via this script)?
I'm a totally n00b script kiddy, but i added to the "if" statement from line 431:
if (Test-Path "$PSScriptRoot\AutopilotConfigurationFile.json" -ErrorAction SilentlyContinue) { Write-Host "
nInjecting AutoPilot configuration file.." -ForegroundColor Yellow
if (test-path "$($usb.scRoot)Windows\Provisioning\Autopilot"){
Copy-Item "$PSScriptRoot\AutopilotConfigurationFile.json" -Destination "$($usb.scRoot)Windows\Provisioning\Autopilot\AutopilotConfigurationFile.json" -Force | Out-Null
}
else {
New-Item -ItemType directory -Path "$($usb.scRoot)Windows\Provisioning\Autopilot"
Copy-Item "$PSScriptRoot\AutopilotConfigurationFile.json" -Destination "$($usb.scRoot)Windows\Provisioning\Autopilot\AutopilotConfigurationFile.json" -Force | Out-Null
}
}
`
...it checks if Autopilot directory is there... if not, create it first and then copy over the AutopilotConfiguration JSON file.