Without a doubt the most common "issue" raised refers to the following error that people recieve while trying to capture the Autopilot config file.
WARNING: Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Please note, this is NOT an issue, but the way to resolve it is simple - you are missing the msal.ps module in the PowerShell 5.1 & Core module locations. Open up BOTH terminals and install the msal.ps module before attempting to use this tool.
Any issues raised regarding this "error" will be immediately closed moving forward.
A module containing tools to assist with the creation of a bootable WinPE USB used to provision devices for enrollment to Intune.
Pretty simple one here.. Only one exposed function
$params = @{
winPEPath = "https://githublfs.blob.core.windows.net/storage/WinPE.zip"
windowsIsoPath = "C:\path\to\win10.iso"
getAutopilotCfg = $true
imageIndex = 5 # Optional parameter
diskNum = 1 # Optional parameter
}
Publish-ImageToUSB @params
Running the Publish-ImageToUSB function will configure a USB with a copy of WinPE, Windows 10 & the required provisioning scripts.
Once you've configured a USB with the tool, using it as a boot device will launch WinPE and kick off "Invoke-Provision.ps1" to configure Windows 10 on the device and apply the Autopilot configuration file.
Once the provisioning script has completed, removing the USB and rebooting the device will bring us to the Windows 10 OOBE and eventually the Autopilot enrollment screen from the configuration file we captured in the first step.
If time permits, I'm looking to add the following additions to the solution:
I'm providing this solution as an educational tool to assist the IT-Pro community with absolutely ZERO warranties or guarantees - I know it works for me, but if it doesn't for you - read the code and fix it..
If you find a problem and want to contribute - please do! I love community involvement and will be as active as my schedule allows.
Lastly, I'm providing a copy of WinPE (which also includes the "Invoke-Provision.ps1" file) on a personal Azure storage account. This will stay up as long as it doesn't begin to cost me too much - if it does, I will take it down. If there are better options, please let me know.
V1.0.1.311
v1.0.1.309
v1.0.1.285
v1.0.1.280
v1.0.1.178
v1.0.1.177