A sample script to register current device into Windows Autopilot. It waits till profile is applied then restarts
If you want to provide feedback or contribute, please use Github website:

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Script -Name AddCurrentDeviceToAutopilot -RequiredVersion 2.3

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More


Piotr Gardy

Package Details



Windows AutoPilot


This script has no dependencies.

Release Notes

Version 2.3: Bugfixing after testing 2.0 version
Version 2.0: Migrated to new Powershell module (Microsoft.Graph.Authentication + Microsoft.Graph.DeviceManagement.Enrolment) p;us more functionalities
Version 1.0: Original published version


Version History

Version Downloads Last updated
2.5 215 7/13/2023
2.4 5 7/13/2023
2.3 (current version) 707 7/24/2022
2.2 584 7/24/2022
2.1 583 7/24/2022
2.0 583 7/24/2022
1.0 757 6/3/2022
Show more