tabs-not-spaces / Intune.USB.Creator

A module containing tools to assist with the creation of a bootable WinPE USB used to provision devices for enrollment to Intune.
GNU General Public License v3.0
132 stars 46 forks source link

AutoPilot info only works on Windows Powershell 5.1? #1

Closed persalmi closed 4 years ago

persalmi commented 4 years ago

I tried to run the USB creation from pwsh 7 but then I never get the AutoPilot / Intune sign-in and profile selection to work. It just skips the admin login and profile selection and continues reporting that the json file does not exist. But it works if I run the Publish-ImageToUSB from an admin Windows Powershell 5.1 prompt. As this seems to differ from your clip running the process from pwsh 7 there must be something I am missing on my machine?

tabs-not-spaces commented 4 years ago

Hey Per,

Make sure you are using the latest build - the required dependencies may need to download to the pwsh7 module location which has only been added in the last 48 hours.

I've just re-ran the module on a few test devices and am 100% getting the prompt for auth to Azure, so without knowing your environment it's difficult for me to identify the issue!

Cheers,

Ben

On Thu, May 28, 2020 at 5:57 PM Per Salmi notifications@github.com wrote:

I tried to run the USB creation from pwsh 7 but then I never get the AutoPilot / Intune sign-in and profile selection to work. It just skips the admin login and profile selection and continues reporting that the json file does not exist. But it works if I run the Publish-ImageToUSB from an admin Windows Powershell 5.1 prompt. As this seems to differ from your clip running the process from pwsh 7 there must be something I am missing on my machine?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tabs-not-spaces/Intune.USB.Creator/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIDA4LLPLZA2LMINZ6OEDZDRTYKOBANCNFSM4NM25VDA .

tabs-not-spaces commented 4 years ago

also, technically, yes the ADAL libraries that the required dependency modules use don't work in 7, but I've got logic in place to allow backwards compatibility.

https://github.com/tabs-not-spaces/Intune.USB.Creator/blob/2ff0fd3de3bed180b749593512da25005c72bf8c/Intune.USB.Creator/Private/Get-AutopilotPolicy.ps1#L11-L24

The only trick is that you NEED the modules in both your 7 & 5.1 module locations for this to work - which is resolved by making sure you install the latest module in the environment you want to use as it should pull down the missing modules..

persalmi commented 4 years ago

Ok, I didn't have the modules installed under 5.1 at first but it did work when running the whole USB creation process under 5.1.