Scripts that I wrote to pre-stage a laptop.
There are two scripts here:
- Pre-Stage.ps1
- OOBE-Requirement.ps1
Pre-stage.ps1 is the one you put on a flash drive and run after connecting to WiFi in OOBE.
OOBE-Requirement.ps1 is the script I use to determine if the device was pre-provisioned.
The process at a high level is this:
- Tech preps the device with a USB drive and a pre-stage PowerShell script.
- The pre-stage script downloads all the install files needed from Azure blob.
- The pre-stage script runs a device setup script that installs Win32 apps
- If everything goes well, we set a success flag.
- The device setup script is also in Intune as a packaged app and in the requirements, it looks for the success flag. So, if it was pre-staged it doesn't run all if it's not pre-staged and it's in Autopilot provisioning it will run the normal process to install everything.