WinPE and Powershell Scripts

Welcome Forums General PowerShell Q&A WinPE and Powershell Scripts

Viewing 6 reply threads
  • Author
    Posts
    • #232099
      Participant
      Topics: 1
      Replies: 3
      Points: 19
      Rank: Member

      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

    • #232114
      js
      Participant
      Topics: 30
      Replies: 828
      Points: 2,556
      Helping Hand
      Rank: Community Hero

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

    • #232225
      Participant
      Topics: 1
      Replies: 3
      Points: 19
      Rank: Member

      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

       

    • #232246
      js
      Participant
      Topics: 30
      Replies: 828
      Points: 2,556
      Helping Hand
      Rank: Community Hero

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

    • #232285
      Participant
      Topics: 1
      Replies: 3
      Points: 19
      Rank: Member

      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 ๐Ÿ™

    • #232315
      Participant
      Topics: 3
      Replies: 421
      Points: 1,479
      Helping Hand
      Rank: Community Hero

      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

    • #232321
      Participant
      Topics: 1
      Replies: 3
      Points: 19
      Rank: Member

      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

Viewing 6 reply threads
  • You must be logged in to reply to this topic.