• Stars
    star
    131
  • Rank 275,867 (Top 6 %)
  • Language
    PowerShell
  • License
    GNU General Publi...
  • Created over 4 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A module containing tools to assist with the creation of a bootable WinPE USB used to provision devices for enrollment to Intune.

Intune.USB.Creator

Build Status PowerShell Gallery PSGallery Downloads

âš âš âš  BEFORE RAISING ANY ISSUES âš âš âš 

Without a doubt the most common "issue" raised refers to the following error that people recieve while trying to capture the Autopilot config file.

WARNING: Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

Please note, this is NOT an issue, but the way to resolve it is simple - you are missing the msal.ps module in the PowerShell 5.1 & Core module locations. Open up BOTH terminals and install the msal.ps module before attempting to use this tool.

Any issues raised regarding this "error" will be immediately closed moving forward.

Summary

A module containing tools to assist with the creation of a bootable WinPE USB used to provision devices for enrollment to Intune.

Pre-Reqs

How to use

Pretty simple one here.. Only one exposed function

$params = @{
    winPEPath = "https://githublfs.blob.core.windows.net/storage/WinPE.zip"
    windowsIsoPath = "C:\path\to\win10.iso"
    getAutopilotCfg = $true
    imageIndex = 5 # Optional parameter
    diskNum = 1 # Optional parameter
}
Publish-ImageToUSB @params

What happens

Running the Publish-ImageToUSB function will configure a USB with a copy of WinPE, Windows 10 & the required provisioning scripts.

Publish-ImageToUSB

Once you've configured a USB with the tool, using it as a boot device will launch WinPE and kick off "Invoke-Provision.ps1" to configure Windows 10 on the device and apply the Autopilot configuration file.

Invoke-Provision.ps1

Once the provisioning script has completed, removing the USB and rebooting the device will bring us to the Windows 10 OOBE and eventually the Autopilot enrollment screen from the configuration file we captured in the first step.

OOBE

What's next?

If time permits, I'm looking to add the following additions to the solution:

  • Warnings and the ability to wipe the USB after use - as this solution is VERY volatile, it may be a good idea to trash the USB after being used.
  • Allowing custom installation media - currently the solution expects that you will use a Windows 10 ISO to extract the install.wim file. I'd like to allow custom *.wim files to be added during the initial process.

Caveat Emptor

I'm providing this solution as an educational tool to assist the IT-Pro community with absolutely ZERO warranties or guarantees - I know it works for me, but if it doesn't for you - read the code and fix it..

If you find a problem and want to contribute - please do! I love community involvement and will be as active as my schedule allows.

Lastly, I'm providing a copy of WinPE (which also includes the "Invoke-Provision.ps1" file) on a personal Azure storage account. This will stay up as long as it doesn't begin to cost me too much - if it does, I will take it down. If there are better options, please let me know.

Release Notes

  • V1.0.1.311

    • ImageIndex & DiskNum variables added to allow non-interactive use of module. (Thanks axgch)
  • v1.0.1.309

    • USB size check implemented - no smaller than 8gb. (Thanks Rob)
    • Autopilot provisioning path now tested (Thanks Rob)
    • Removed daily flag from pwsh7 installer ( Thanks jmaystahl)
  • v1.0.1.285

    • Adding in warning messages to invoke-provision script.
    • Moved Invoke-Provision out of the WinPE media and now pulling from GitHub.
  • v1.0.1.280

    • Updated module dependencies to be auto-installed
    • Removed support for Out-ConsoleGridView for less required dependencies
    • Improved windows PowerShell compatibility for modules not natively supported in PowerShell 7.
  • v1.0.1.178

    • UI improvements - typo fixes
  • v1.0.1.177

    • Initial release of module.

More Repositories

1

CodeDump

things that help me. might help others.
PowerShell
105
star
2

Intune-App-Deploy

A fast, reliable way to package your win32 applications and deploy them to Intune from any source - including SCCM!
PowerShell
85
star
3

Intune.HV.Tools

A set of tools to assist with the creation of Intune managed virtual machines in Hyper-V.
PowerShell
71
star
4

Intune.Reporting

Create shiny reports for your boss - with PowerShell!
PowerShell
48
star
5

Hyper-ConvertImage

Microsoft hasn't published any approved PRs on their Convert-WindowsImage module in years. This is a more recent version.
PowerShell
32
star
6

Intune-Win32-App-Upload

Programatically upload win32 (*.intunewin) media to Intune!
PowerShell
14
star
7

Intune.Logonscript.FunctionApp

Azure Function App to serve as midddleware for a logon script solution for cloud managed devices.
PowerShell
13
star
8

Intune-Plaster-Build

build out your intune environment using nothing but a basic yaml file!
PowerShell
11
star
9

Intune.LogonScript.Helper

Function App solution to help with getting on-prem file shares and printers into modern management.
PowerShell
11
star
10

Intune.LogMonitor.Tools

A set of PowerShell tools to aid with troubleshooting win32 applications for Intune in the event that you have lost the source media.
PowerShell
11
star
11

VSCode_RestClient_Demo

Demo to play with Graph in VS Code
PowerShell
8
star
12

Az.MsiGraphPermissions

Graph Permissions in a managed identity? In this eoconomy????
PowerShell
6
star
13

Intune.Certificate.Management

Automate all the ways to generate certificate policies
PowerShell
5
star
14

OneDrive4BusinessAutoConfig

Scripts required to deploy for silent auto config of OneDrive for Business
PowerShell
4
star
15

powers-hell-blog

new home for powers-hell.com blog
JavaScript
4
star
16

WindowsTerminalTheme

My WT Theme. For anyone to use.
4
star
17

Az.ImageBuilder.Tools

Azure Image Builder configuration done right(ish).
PowerShell
3
star
18

MMS2024Demos

Demo code for MMS 2024
PowerShell
3
star
19

PSCONFEU2023-API

LETS BUILD AN API
3
star
20

MMSMOA2023

slide decks and code for MMSMOA2023
PowerShell
2
star
21

SuperSecret.Tools

New-AzADAppCredential doesn't generate client secrets. So Let's just do it ourselves.
PowerShell
2
star
22

PSCONFEU2024

Another PowerShell conference... in this economy??!!
PowerShell
2
star
23

zmk-config

zmk config
1
star
24

PSConfEU2022-AzFunctionApp

Hey Cool - We are in Austria doing cool shit.
PowerShell
1
star
25

tabs-not-spaces

1
star
26

PSConfEU-2020

Example code for PSConfEU presentation
PowerShell
1
star
27

PSCONFEU2023-MSAL

Auth aint hard
PowerShell
1
star