New-OSDBoot.usb

So I need to create a new function in the OSD Module to create a Dual Partition USB for OSDcloud. So this page will be the process of how I create one for the OSD Module. Keep in mind, by no means am I a PowerShell expert ... I'm still learning

Requirements

So here are the requirements for creating a New-OSDBoot.usb

  • Must run as Admin

  • Require Windows 10

  • PowerShell 5+

  • Windows 10 1703+

  • USB Drive > 8GB

    • 4GB ESD + some room for Drivers, etc

The Old Code

So I already have a script to handle the requirements, and I'm not trying to make you go blind, but this requires 92 lines. I used to copy/paste similar steps in new code, but that's not the point of the OSD Module

The New Code

As you can see I ended up putting all of those checks in new functions making things very easy to code in just 11 lines in the Function

The Block

The improvements continue when you look at the new Block functions in the #OSD Module by using PSCallStack, which really makes this small Block function easy to reuse in other Functions

The Build

Last updated

Was this helpful?