Forum Discussion
Sk-73
Dec 09, 2021Iron Contributor
Microsoft Intune Auto Pilot Command for OOBE
Dear all,
Does anyone know how to combine the below command as a bat file?
Type in PowerShell
Type in Set-ExecutionPolicy bypass
Type in Install-Script -Name get-WindowsAutoPilotInfo -Force
Type in Y hit enter
Type in Get-WindowsAutoPilotInfo.ps1 -Online
Will be grateful for any help you can provide.
Thank you.
Sk-73
- Build a script containing something like below and create a cmd/bat file containing "powershell.exe -executionpolicy bypass -file .\name-of-script.ps1"
Name-of-script.ps1
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Install-PackageProvider NuGet -MinimumVersion 2.8.5.201 -Force | Out-Null
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Script -Name get-WindowsAutoPilotInfo -Force
Get-WindowsAutoPilotInfo.ps1 -Online
2 Replies
- Build a script containing something like below and create a cmd/bat file containing "powershell.exe -executionpolicy bypass -file .\name-of-script.ps1"
Name-of-script.ps1
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Install-PackageProvider NuGet -MinimumVersion 2.8.5.201 -Force | Out-Null
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Script -Name get-WindowsAutoPilotInfo -Force
Get-WindowsAutoPilotInfo.ps1 -Online- Sk-73Iron Contributor
Thank you for the command, it works! You're awesome!
How I do is I save the command as .ps1 > put the ps1 file into the C:\\ Temp folder > open PowerShell run as admin > type in cd C:\Temp\ hit enter then type in the file-name.ps1