SOLVED

Microsoft Intune Auto Pilot Command for OOBE

Iron Contributor

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

 

2 Replies
best response confirmed by Sk-73 (Iron Contributor)
Solution
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

Hi @Harm_Veenstra

 

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

 

Sk73_0-1640596296239.png

 

1 best response

Accepted Solutions
best response confirmed by Sk-73 (Iron Contributor)
Solution
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

View solution in original post