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

Injecting AutPilot Configuration file error #7

Closed
Ezmoshow opened this issue Jul 9, 2020 · 4 comments
Closed

Injecting AutPilot Configuration file error #7

Ezmoshow opened this issue Jul 9, 2020 · 4 comments
Labels
good first issue Good for newcomers

Comments

@Ezmoshow
Copy link

Ezmoshow commented Jul 9, 2020

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!

@Ezmoshow
Copy link
Author

Ezmoshow commented Jul 9, 2020

Just adding... the above still occurs, not sure why, but everythign seems to be working normally despite that ConfigFile.json injection error.

@Ezmoshow
Copy link
Author

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)?

@tabs-not-spaces
Copy link
Owner

tabs-not-spaces commented Jul 10, 2020 via email

@tabs-not-spaces tabs-not-spaces added the good first issue Good for newcomers label Jul 10, 2020
@Ezmoshow
Copy link
Author

Ezmoshow commented Jul 11, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants