WinPE and Powershell Scripts

Hi all,

New to the forums but hope I am okay to ask a question. I am trying to run powershell in a bootable WinPE. I can load powershell and modify the file structure. I have tested the scripts on my developer machine but cant get them to run within WinPE. The Script I am trying to run is get-windowsautopilotinfo -online.

I have copied the script to the WinPE system, tried with set-executionpolicy bypass

tried with .\ before the file name

I do get errors relating to the term (FILENAME) is not reconized as the name of a cmdlet, function, script file…

I have also copied over my devs workstation powershell scripts folder but no joy.

Any ideas?

Thanks

Rich

What is the exact error message? Note that winpe doesn’t have all the wmi classes that full blown windows does.

Hi JS,

The error I am currently trying to sort is the below

Error

If the image wont show URL below

https://ibb.co/nckLbzL

Thanks,

Rich

 

Yep, the namespace of that wmi class isn’t there in winpe.

Thanks for the reply, I have looked on google and assume that there is no way to add this in? My goal was to try and automate the upload of machine hash ID’s to autopilot using a bootable USB drive. The smallest OS I could find was WinPE :frowning:

Are you an OEM or reseller? Everything I see says this needs to be done in windows 10. But it also seems it’s either handled by the vendor or management platform such as intune or SCCM. The doc says specifically the manual process should be for testing only.
https://docs.microsoft.com/en-us/windows/deployment/windows-autopilot/add-devices

Hi Doug,

Reseller. I have got the script to work now but had to ditch the bootable media for now. Running it via MDT for the most part.

Thanks,

Rich