# OSD PowerShell Module

The OSD PowerShell Module is a collection of Functions related to OS Deployment.  These functions are used is [OSDBuilder](https://osdbuilder.osdeploy.com/) and everything you need to do [OSDCloud](https://osdcloud.osdeploy.com/) is in this Module

## Admin Rights

Many of the functions in this Module require Admin Rights so make sure you keep that in mind

## Execution Policy

If you are new here, make sure you set your Execution Policy

```
Set-ExecutionPolicy RemoteSigned -Force
```

## Install

If you have a pulse and an internet connection, use this command

```
Install-Module OSD -Force
```

## Update

Things here are changed frequently so to make sure you have the latest, simply run the Install command again or use this command

```
Update-Module OSD
```

## Import

Finally, don't forget to Import it before you run any of the functions

```
Import-Module OSD -Force
```

{% embed url="<https://www.recastsoftware.com/?utm_source=osdeploy&utm_medium=ad&utm_campaign=web>" %}
OSDeploy is sponsored by Recast Software
{% endembed %}


# OSDPad

21.8.10.3+

OSDPad is a PowerShell GUI containing a TextBox and a Run button.  This allows you to write a PowerShell script and execute it in a new PowerShell Window.  By itself, this is not entirely useful at all, and it is certainly not considered an "Editor" since there is no syntax highlighting ... but that's not the main goal of OSDPad ... so keep reading

## OSDPad

To run OSDPad, simply use either of the following commands

```
OSDPad
Get-OSDPad
```

{% hint style="warning" %}
If you receive an error when running either command, update the OSD Module in your OS and WinPE to 21.8.10.3 or newer
{% endhint %}

![](/files/-MgkZ-irn3rHA84Nng0X)

Like I mentioned earlier, not the most useful in Windows, but in WinPE it fills a gap where PowerShell ISE isn't an option

![](/files/-MgkdVLXl48WIAV7a73Q)

## GitHub Integration

Where OSDPad shines is its ability to pull PowerShell script from GitHub, as simple as 1-2-3

![](/files/-MgkeEV4icFAcpbXsd-p)

With this, I can pull any public GitHub Repo containing PowerShell scripts into OSDPad using either of the following commands

```
OSDPad OSDeploy OSDHelp OSDCloudDeploy
Get-OSDPad -RepoOwner OSDeploy -RepoName OSDHelp -RepoFolder OSDCloudDeploy
```

And here is how things look in WinPE.  I'm able to review, edit, and run whatever I need. &#x20;

![](/files/-Mgkf3YMjP52Ijd5Extp)

## Workflow Improvement

I develop and test on multiple devices (physical and virtual), and in WinPE, OOBE, and full Windows.  OSDPad has removed my need for mapping a Network Drive or plugging in a USB to get PowerShell  scripts that I'm working on.  This has led to an incredible amount of time savings and increased my productivity

## Dumb IT

I've mentioned before about how I believe that Supes that automate too much, while increasing productivity, also end up 'dumbing down' down support staff.  For example, I doubt any of my support staff can run Get-WindowsAutopilotInfo manually as they are well versed in AutopilotOOBE

{% embed url="<https://twitter.com/SeguraOSD/status/1392389774929969152>" %}

The great thing about OSDPad is it brings the PowerShell Script that is needed to solve a problem front and center where it can be seen, reviewed, edited, and executed.  This gives an opportunity to learn and understand the solution

## Instant GUI

Having an instant GUI available without having to actually make a GUI makes things easier to get released.  In the screenshot below, I have all my OOBE scripts ready for me to test ... and I can work on a GUI when I have time

![Start-OSDPad -RepoOwner OSDeploy -RepoName OSDPad -RepoFolder OOBE](/files/-MgkjYonqiwuVcNLrx6T)

## Collaboration

Finally, OSDPad makes it easy to collaborate and share your PowerShell scripts with the Community.  I'll be using this during my next Teams meeting or Presentation to easily make my scripts available to share

## Customization

So you're not so keen on the default look and color?  Change it up

![](/files/-MgkpFCsxO3JGzW6hziZ)

Don't want to show your script to your support staff?  Hide it.

![](/files/-MgkqQA3V7ryawHidXIL)

Whatever you do, have fun with it!

## Sponsor

{% embed url="<https://www.recastsoftware.com/?utm_source=osdeploy&utm_medium=ad&utm_campaign=web>" %}
OSDeploy is sponsored by Recast Software
{% endembed %}


# OSDHelp

In a nutshell, **`OSDHelp`** is a PowerShell function (**`Get-OSDHelp`**) that opens a GitHub Repository in **`OSDPad`**.  My goal is to populate this with PowerShell Scripts that can help you perform tasks, or learn a little PowerShell.  Any script in OSDHelp can be edited and customized before you run it

## Install

To install and use **`OSDHelp`**, you need to first install the OSD PowerShell Module.  Use the following commands in PowerShell (as Admin)

```
Install-Module OSD -Force
Import-Module OSD -Force
```

If you are in OOBE, you can do this from the Command Prompt using these commands.  You will need to press Shift + F10 to open a Command Prompt first

```
PowerShell
Set-ExecutionPolicy RemoteSigned -Force
Install-Module OSD -Force
Import-Module OSD -Force
```

## Usage

**`OSDHelp`** can be run using either of the following commands.  It is strongly recommended that you always run OSDHelp in an Elevated PowerShell session as many of the scripts require Admin Rights

```
OSDHelp
Get-OSDHelp
```

These commands are equivalent to the following **`OSDPad`** command line.  In a nutshell, **`OSDHelp`** is really just a shortcut for **`OSDPad`**

```
OSDPad -RepoOwner OSDeploy -RepoName OSDHelp
```

{% hint style="warning" %}
Content in OSDHelp changes frequently to add or update scripts
{% endhint %}

## RepoFolder

**`OSDHelp`** scripts are organized in directories in the GitHub Repository.  These directories are also known as a **`RepoFolder`**.  If you run **`OSDHelp`** without specifying a **`RepoFolder`**, you are simply presented with a **`Readme.md`** which serves as an Index so you know what RepoFolders are available

![](/files/-MhHIMP2RC-6py3Bs5ea)

You can also look in the minimized PowerShell Console and see the GitHub Directories (**`RepoFolder`**)

![](/files/-MhHKYC3azcbbKFF6PvE)

Now that you know what **RepoFolder** you can use, simply close **`OSDHelp`** (**`OSDPad`**) and go back to PowerShell and give it a try

```
OSDHelp Autopilot
```

## Script Dependencies

Scripts may require a Script or a Module install before executing.  You can see how this is done in the following OSDHelp Script

```
#Requires -RunAsAdministrator
#================================================
#   Install Script
#================================================
if (!(Get-Command Get-WindowsAutoPilotInfo -ErrorAction Ignore)) {
    Install-Script Get-WindowsAutoPilotInfo -Force -Verbose
}
#================================================
#   Parameters
#   [[-Name] <String[]>]
#   [-OutputFile <String>]
#   [-GroupTag <String>]
#   [-AssignedUser <String>] 
#   [-Append]
#   [-Credential <PSCredential>]
#   [-Partner]
#   [-Force]
#   -Online
#   [-TenantId <String>]
#   [-AppId <String>]
#   [-AppSecret <String>]
#   [-AddToGroup <String>] 
#   [-AssignedComputerName <String>]
#   [-Assign]
#   [-Reboot]
#================================================
& "$env:ProgramFiles\WindowsPowerShell\Scripts\Get-WindowsAutoPilotInfo.ps1"
```

## Script Transcript Logging

Many of the scripts will save a Transcript.  In most cases, these are saved in Windows Temp or User Temp.  In the following script in particular, this is saved in C:\Temp so the Transcript can be retreived by a Standard User.  This is by design

```
#Requires -RunAsAdministrator
#================================================
#   Initialize
#================================================
$Title = 'EventMonitor_Autopilot'
$host.ui.RawUI.WindowTitle = $Title
$host.UI.RawUI.BufferSize = New-Object System.Management.Automation.Host.size(2000,2000)
#================================================
#   Temp
#================================================
if (!(Test-Path "$env:SystemDrive\Temp")) {
    New-Item -Path "$env:SystemDrive\Temp" -ItemType Directory -Force
}
#================================================
#   Transcript
#================================================
$Transcript = "$((Get-Date).ToString('yyyy-MM-dd-HHmmss'))-$Title.log"
Start-Transcript -Path (Join-Path "$env:SystemDrive\Temp" $Transcript) -ErrorAction Ignore
#================================================
```

## GitHub Reposository

If you're insterested, here is the **`OSDHelp`** Script Repository on GitHub

{% embed url="<https://github.com/OSDeploy/OSDHelp>" %}

## Sponsor

{% embed url="<https://www.recastsoftware.com/?utm_source=osdeploy&utm_medium=ad&utm_campaign=web>" %}
OSDeploy is sponsored by Recast Software
{% endembed %}


# Autopilot

{% hint style="danger" %}
This page is currently under development
{% endhint %}

OSDHelp Autopilot contains PowerShell scripts that can be used to help you with Autopilot related tasks

## Readme.md

You can launch these scripts and open the Readme.md using the following PowerShell Command.  Since most of the scripts in OSDHelp require Admin Rights, you should always run OSDHelp in an Elevated PowerShell session

```
OSDHelp Autopilot
```

The Readme.md will be presented first to detail the contained scripts

![](/files/-MhHRhhH7QPJPfDGfyOH)

## Run Me First

I strongly recommend you review, edit, and run this script to your specific needs

```
#================================================
#   Disable Console Line Wrap
#   If you plan on using EventMonitor, your lines can get
#   very long. To keep things straight, turn off Line Wrap
#   with this Registry setting
#================================================
reg add HKCU\Console /v LineWrap /t REG_DWORD /d 0 /f

#================================================
#   Set-DisRes 1600 for Virtual Machine
#   If you are using Hyper-V, it may be helpful
#   to bump up your Display Resolution
#================================================
if ((Get-MyComputerModel) -match 'Virtual') {
    Write-Host  -ForegroundColor DarkCyan 'Set-DisRes 1600'
    Set-DisRes 1600
}

#================================================
#   Open URI Display Settings
#   If you are in OOBE, things can get crowded
#   Make sure your Display Scaling is set to 100%
#================================================
Start-Process ms-settings:display

#================================================
#   Open Default Browser
#   If you need to authenticate to a Firewall while
#   in OOBE then this will get things working
#================================================
start www.msn.com
```

I'm not going to go into detail on this website what each and every script does,  so please make sure you review the Readme.md and any Run Me First script

![](/files/-MhKhi3Gx-m_GskfVadm)


# Guides


# UEFI System Firmware Update

OSD 21.7.11.1

{% embed url="<https://www.recastsoftware.com/?utm_source=osdeploy&utm_medium=ad&utm_campaign=web>" %}
OSDeploy is sponsored by Recast Software
{% endembed %}

## OSD Module

Make sure that your OSD Module is at least version 21.7.11.1.  Once you have that, you can use Get-MyBiosVersion to check your current BIOS version

![](/files/-MeJYaXxuOXTwWGTHbvO)

{% hint style="warning" %}
Installing Firmware Drivers will require Admin Rights, and make sure you have your Bitlocker Keys backed up and that you suspend Bitlocker before any updates
{% endhint %}

## UEFI Firmware Update Platform

Before going any further, its important to understand what the Windows Firmware update platform is.  Enjoy the read and come back when you are up to speed

{% embed url="<https://docs.microsoft.com/en-us/windows-hardware/drivers/bringup/windows-uefi-firmware-update-platform>" %}

## Device Manager

Taking the information from the Microsoft Windows UEFI firmware update platform link, you can see that (on Windows 10) the System Firmware is in Device Manager.  Digging into the Details provides a value for the Firmware Resource ID

![](/files/-MeJNDlvGxVMakX9y3TM)

You can get this information from PowerShell using **`Get-CimInstance`**

![](/files/-MeJOjc7SKYWsgMZdjZ2)

Or use two new OSD Functions to provide this information

![](/files/-MeJONrbAj00pPUlXhzw)

## Microsoft Update Catalog

Finally you can take the System Firmware Resource (Guid) and run a search in Microsoft Update Catalog and you should be able to find the matching UEFI Firmware Updates for your system.  Just select the newest one and download the CAB

![](/files/-MeJQ8WNcdxdIiUR24oN)

{% embed url="<https://www.catalog.update.microsoft.com/Search.aspx?q=%7bDB72C932-B3C6-4640-B382-3F4619AB447B%7d>" %}

## MSCatalog Module

You can also query the Microsoft Update Catalog directly with the MSCatalog PowerShell Module written by [Ryan Kowalewski](https://ryanjan.uk/)

{% embed url="<https://ryanjan.uk/download-and-install-offline-windows-updates/>" %}

{% embed url="<https://www.powershellgallery.com/packages/MSCatalog/0.24.0>" %}

## Get and Save SystemFirmwareUpdate

To make things easier for you, these two OSD Functions will help speed things along.  **`Get-SystemFirmwareUpdate`** will return the newest UEFI System Firmware for your device and **`Save-SystemFirmwareUpdate`** will download the Update and expand the package

![](/files/-MeJZpN8XcXodPO5CNnu)

## Install

Installation is quite simple.  Simply right click on the firmware.inf and Install

{% hint style="warning" %}
Remember about suspending Bitlocker first!
{% endhint %}

![](/files/-MeJ_KXqeuXSNNCY8BSh)

## Next Steps

Look for this to be added to OSDCloud soon after some more testing


# In Your Code

{% hint style="success" %}
**OSD Module isn't just for Task Sequences ...**&#x20;
{% endhint %}

#### You can easily use OSD Module in your own PowerShell Modules and Scripts

## PowerShell Modules

#### In your Module Manifest (PSD1), include the OSD Module in RequiredModules

```
RequiredModules = @(
    @{ModuleName = 'OSD'; ModuleVersion = '19.10.10.0'; Guid = '9fe5b9b6-0224-4d87-9018-a8978529f6f5'}
)
```

![](/files/-LqrD9Hy58j3vHuOkArc)

#### OSDBuilder uses the OSD Module in some of its code.  In this example, IsAdmin is being evaluated as this function requires Admin Rights

![](/files/-LqrCxa3OA-s9HKntBe1)


# 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

![](/files/-MW2LefLPO1sIHQS6Ss7)

### 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

```
function New-OSDBoot.usb {
    [CmdletBinding()]
    param ()
    Block-WinPE
    Block-NonAdmin
    Block-WindowsMajorLt10
    Block-PowerShellVersionLt5
    Block-WindowsReleaseIdLt1703
    $SelectUSBDisk = Select-USBDisk -MinimumSizeGB 8
    Return Get-USBDisk -Number $SelectUSBDisk.Number
}
```

![](/files/-MW2MpUgd2FW2h7jGKfz)

### 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

![](/files/-MW2NLReTNQhGuQZfJAh)

```
function Block-NonAdmin {
    [CmdletBinding()]
    param ()
    $FirstParty = (Get-PSCallStack)[1].InvocationInfo.Line
    $Message = "[$((Get-Date).ToString('yyyy-MM-dd-HHmmss'))] $FirstParty requires Admin Rights"

    if ((Get-OSDGather -Property IsAdmin) -eq $false) {
        Write-Warning $Message; Break
    }
}
```

## The Build


# Partitions

#### Let's face it, letting Windows Setup absolutely sucks at creating Partitions.  Let's take for example this Unallocated Space on a Drive and see what happens when Windows 10 1903 is installed with BIOS (MBR) and UEFI (GPT)

![](/files/-LqgeklpGAK5KV9Z87MA)

## BIOS MBR Windows Setup Defaults

#### On the outside, this doesn't look too bad, just two partitions.  WinRE is in System Reserved

![](/files/-LqgfSr9uJV5kNY8F6uv)

#### But by Microsoft's own guidance, that's not how it should look ...

![](/files/-LqggBxB8L265aXSswJE)

![](/files/-LqggqmQ5GafMp6i9wSp)

#### And Microsoft even provides you with the code to do it (PowerShell????)

```
rem == CreatePartitions-BIOS.txt ==
rem == These commands are used with DiskPart to
rem    create three partitions
rem    for a BIOS/MBR-based computer.
rem    Adjust the partition sizes to fill the drive
rem    as necessary. ==
select disk 0
clean
rem == 1. System partition ======================
create partition primary size=100
format quick fs=ntfs label="System"
assign letter="S"
active
rem == 2. Windows partition =====================
rem ==    a. Create the Windows partition =======
create partition primary
rem ==    b. Create space for the recovery tools  
rem       ** Update this size to match the size of
rem          the recovery tools (winre.wim)
rem          plus some free space.
shrink minimum=500
rem ==    c. Prepare the Windows partition ====== 
format quick fs=ntfs label="Windows"
assign letter="W"
rem == 3. Recovery tools partition ==============
create partition primary
format quick fs=ntfs label="Recovery"
assign letter="R"
set id=27
list volume
exit
```

{% embed url="<https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/configure-biosmbr-based-hard-drive-partitions>" %}

## UEFI GPT Windows Setup Defaults

#### With GPT Partitions, things work

![](/files/-LqghHFPNxFBK1Iz4hyv)

#### But again, Windows Setup doesn't play by the rules

![](/files/-LqghWnd5o-KHi10uAEO)

```
rem == CreatePartitions-UEFI.txt ==
rem == These commands are used with DiskPart to
rem    create four partitions
rem    for a UEFI/GPT-based PC.
rem    Adjust the partition sizes to fill the drive
rem    as necessary. ==
select disk 0
clean
convert gpt
rem == 1. System partition =========================
create partition efi size=100
rem    ** NOTE: For Advanced Format 4Kn drives,
rem               change this value to size = 260 ** 
format quick fs=fat32 label="System"
assign letter="S"
rem == 2. Microsoft Reserved (MSR) partition =======
create partition msr size=16
rem == 3. Windows partition ========================
rem ==    a. Create the Windows partition ==========
create partition primary 
rem ==    b. Create space for the recovery tools ===
rem       ** Update this size to match the size of
rem          the recovery tools (winre.wim)
rem          plus some free space.
shrink minimum=500
rem ==    c. Prepare the Windows partition ========= 
format quick fs=ntfs label="Windows"
assign letter="W"
rem === 4. Recovery tools partition ================
create partition primary
format quick fs=ntfs label="Recovery tools"
assign letter="R"
set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
gpt attributes=0x8000000000000001
list volume
exit
```

{% embed url="<https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/configure-uefigpt-based-hard-drive-partitions>" %}


# New-OSDDisk (Information)

#### So here's a cool OSD Function ... if you happen to have PowerShell added to WinSE, and the OSD Module, you can easily partition your drive ... the right way

#### You'll start by holding down left Shift + F10 to open a Command Prompt, then enter PowerShell.  Once PowerShell is started, you can use New-OSDDisk without any parameters for Information Mode

## No Existing Partitions

![](/files/-LqrEEtpk544eD2ZAnJe)

If things look correct, you can just add the Force parameter

![](/files/-LqrEQ1ptdmOdyKyaDl9)

![](/files/-Lqglbqib09Q0fYBOUp-)

#### Now you need to confirm that the Drive will be cleaned.  Just press Enter to accept the default of Y

![](/files/-LqgllxSZluaITrqRmC-)

#### Now its time to make the new Partitions.  You have the option of entering the Disk Number, or just pressing X to quit the script.  Type 0 and press Enter

![](/files/-Lqgm1pLZAfmTb0nODUj)

![](/files/-Lqgm4CMHkWXPiUiV9YR)

#### And that's it.  Here is what Windows Setup looks like now

![](/files/-LqgmFsnhW7SHSWzaNRS)

### In GIF Action

![](/files/-LqgkcWMLU5zRexBUqoC)


# New-OSDDiskWinPE (GPT)

#### You'll start by holding down left Shift + F10 to open a Command Prompt, then enter PowerShell.  Once PowerShell is started, run New-OSDDiskWinPE

#### The first prompt is a Warning that you will lose everything on the Hard Drive if you keep going ... Press Enter to continue

![](/files/-LqgvPBuiottUrO9YplU)

#### Now here is the prompt where Clear-Disk will destroy your data.  Press Enter, or Y then Enter

![](/files/-Lqgvbl6Wea1MnGl0N9T)

#### Now you are prompted before the Partitions are created.  Enter the number of the Disk, which is 0 and press Enter (or just press Enter since nothing = 0)

![](/files/-LqgvjpLUScyAgy19lH4)

Now the magic begins

![](/files/-Lqgw5PYgJUqyF7ctfXi)

![](/files/-Lqgw7618QNop3irC1UW)

![](/files/-Lqgw8GGViD1gPQLhEYZ)

#### Now the Partitions are perfect

![](/files/-LqgwEdG4RHO-TT-V9dg)


# New-OSDDiskWinPE (2 Disks)

Let's say you have more than one Disk, things will look a little different

![](/files/-LqgwZiWx1JgaZoKaxsK)

#### You will be prompted for each disk that's installed, and you can even select the second Disk, which is Disk 1

![](/files/-LqgwqdE20v_tTmIv4ip)

![](/files/-LqgwydLdq1uHRXY_ppA)

#### Make sure you select the OS Partition (Windows will still want to select Disk 0)

![](/files/-Lqgx5W9dZb8GH-iqKWf)

#### And here is how it looks in Windows

![](/files/-LqgyuUHxqQ4B8umKnEo)


# AutoUnattend.xml

#### Here's an example of adding this to an AutoUnattend.xml.  In this example, I have added some Parameters

* UEFI System Partition = 500MB
* Recovery Partition = 800MB
* OS Partition Label = OSDeploy

#### I've also added a Transcript which saves to X:\Sources by default, and a Sleep timeout of 5 seconds so I can get a screenshot

```
<RunSynchronousCommand wcm:action="add">
    <Order>4</Order>
    <Description>New-OSDDiskWinPE</Description>
    <Path>PowerShell -Command "& {Start-Transcript|Out-Null;New-OSDDiskWinPE -SSU 500MB -SR 800MB -LO OSDeploy;Stop-Transcript;Sleep -S 5}"</Path>
</RunSynchronousCommand>
```

#### This is what it looks like during RunSynchronousCommand processing

![](/files/-Lqgz3uO0v2S_Uuzv-SI)

#### And the Partitions in Windows Setup

![](/files/-Lqgz86Vbc4pPFYGEJsB)


# OSDWindowsImage

David Segura @SeguraOSD

#### There aren't many days that I don't mount a WIM file ... which is where these two functions will become my primary tools

{% hint style="warning" %}
**Before you start playing around with this, make sure you update the OSD Module to 19.11.22 or newer and that you have the OSDSUS Module installed and updated ...**
{% endhint %}

## Functions

{% content-ref url="/pages/-LuGfgiq5vjs\_Ela0mly" %}
[Broken mention](broken://pages/-LuGfgiq5vjs_Ela0mly)
{% endcontent-ref %}

{% content-ref url="/pages/-LuBEajp4upAZSVVKZnO" %}
[Broken mention](broken://pages/-LuBEajp4upAZSVVKZnO)
{% endcontent-ref %}

## Mount-WindowsImage

#### Mount-OSDWindowsImage is based off of Mount-WindowsImage.  So why the need for a new function?  Here's a few reasons

* **I can't just specify a WIM**
* **I have to specify an Index**
* **My Path (Mount Directory) needs to exist**

![](/files/-LuGjH_vt4PbMCh2Y0Li)

## Mount-OSDWindowsImage

For starters, all you need to provide is a WIM (Position 0).  There is no need to specify an Index as Index 1 is assumed if one is not provided.

### Mount WIM

The WIM is mounted to a Random directory in $env:TEMP.  This directory is automatically created

![](/files/-LuGkNxJFsdHoO-NVaK8)

### Mount and Explore

And finally, the Explorer parameter will automatically open Windows Explorer to the Mount Path

![](/files/-LuGm0H3hepKjFFAPCX5)

## Update-OSDWindowsImage

#### Finally this is the gem for those of you that [Hate OSDBuilder](https://www.osdeploy.com/blog/2019-11/i-hate-osdbuilder).  You will need an up to date [OSDSUS](http://osdsus.osdeploy.com) for this to work properly

### Windows Image Mount Path Is Optional

Yes Boys and Girls, this is quite a treat.  Simply run the function without any Parameters.  If you have a Mounted Windows Image, it will find it ... and let you know if it needs any updates

![](/files/-LuH0iW7W5lGe9KeBrgQ)

### Multiple Windows Images - Mounted

Ok, did I just mount three WIMS in a single command line?  Ok, now I'm just showing off ... but as you can see, `Update-OSDWindowsImage` will find all three and give me an update

![](/files/-LuH1ysTIgd4PdAGMCaz)

### Multiple Windows Images - Mount | Update | Dismount

If you thought that was it ... yes you can use this in the Pipeline

![](/files/-LuH2yktPojbPo1tuzRC)

### Install Updates

#### OK, I think you get the idea of the different ways you can use it ... so let's focus on the Updates.  You can use these Update values

* **Check (Default)**
* **All**
* **SSU**
* **LCU**
* **DotNet**
* **DotNetCU**

#### And there's even a BitsTransfer parameter too!

![](/files/-LuH6NbX-0DdqtaPxq1_)

### One-Liner

#### So here is your PowerShell One-Liner to Mount, Identify the OS, Identify the Required Updates, Download the Updates, Apply the Updates, and finally, Dismount and Save an Install.wim.  This by far makes the shortest WIM Update script ever.  Enjoy!

```
Mount-OSDWindowsImage T:\WimOS\install.wim | Update-OSDWindowsImage -Update All | Dismount-WindowsImage -Save
```

![](/files/-LuH9pSjprDBtWbnpUpa)

#### Or you can Script the solution for better readability

![](/files/-LuJfUf70YMDGUobuCsy)

### Downloads and Logs

#### If you need the Downloads and Logs (you know how I am about Log files), simply look in $env:TEMP\OSD

![](/files/-LuHAiJ-jQfQJHoWHRWv)

## OSD Helper Functions

#### Finally some other functions from the OSD Module were used to make this all work

### Identify the Mounted OS Information

{% content-ref url="/pages/-LuBEPNSdBAHBxwAbhfF" %}
[Get-RegCurrentVersion](/docs/trash/general/get-regcurrentversion)
{% endcontent-ref %}

### Identify the Installed Updates

{% content-ref url="/pages/-Lu8WzYXTAzv5rwlJKCg" %}
[Get-SessionsXml](/docs/trash/general/get-osdsessions)
{% endcontent-ref %}

### Download the Updates

{% content-ref url="/pages/-LuBETWsGdbr5jftxBsM" %}
[Save-OSDDownload](/docs/trash/general/save-osddownload)
{% endcontent-ref %}


# Windows Setup Environment

{% hint style="info" %}
**To open a Command Prompt in WinSE, hold down SHIFT + F10**
{% endhint %}

#### When you boot a computer using Windows 10 Media, you are booting to the Windows Setup Environment.  I refer to this as WinSE (yes, just like WinPE and WinRE).  WinSE exists as Index 2 of the Boot.wim

![](/files/-Lq-eeaE1Xx6HesXb4x3)

## PowerShell and OSD Module

#### Through the Magic of Offline Servicing, I can add PowerShell to WinSE (OSDBuilder helps) and start doing some fun stuff.  Using the magic of OSDBuilder ExtraFiles, I decided to add the OSD Module to WinSE so I can have some fun.  Here is where you need to save the OSD Module

```
<Mount>\Windows\System32\WindowsPowerShell\v1.0\Modules
```

![](/files/-Lq-fFz515db3KHIczNO)

## ExecutionPolicy Restricted

#### Unfortunately WinSE's PowerShell Execution Policy doesn't help me out because this prevents the loading of PowerShell Modules.  I'll detail in the next page how to take care of this

![](/files/-Lq-fn1XwEDThSBRd6qQ)


# Execution Policy

#### There are a few ways to set the PowerShell Execution Policy in WinSE.  I'll start with the easiest

## AutoUnattend.xml Method

#### By far the easiest way to set the PowerShell Execution Policy to Bypass is to use an AutoUnattend.xml with a RunSynchronous Command

```
    <settings pass="windowsPE">
        <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <UserData>
                <AcceptEula>true</AcceptEula>
                <ProductKey>
                    <Key>NPPR9-FWDCX-D2C8J-H872K-2YT43</Key>
                    <WillShowUI>Never</WillShowUI>
                </ProductKey>
            </UserData>
            <RunSynchronous>
                <RunSynchronousCommand wcm:action="add">
                    <Order>1</Order>
                    <Description>OSD ExecutionPolicy</Description>
                    <Path>PowerShell -WindowStyle Hidden -Command "Set-ExecutionPolicy Bypass"</Path>
                </RunSynchronousCommand>
            </RunSynchronous>
        </component>
    </settings>
```

#### That does the trick

![](/files/-Lq-iBXnNTaASCW9HGZ8)

## Driver Method (OSDBuilder)

#### You can easily create your own Driver INF and add that to WinSE (WinPE and WinRE too) to set the Execution Policy.  OSDBuilder easily lets you add this Driver

{% code title="RegAdd PowerShell ExecutionPolicy.inf" %}

```
;==================================================================================================
;   David Segura
;   https://www.osdeploy.com
;==================================================================================================
;   Purpose: Set PowerShell ExecutionPolicy to Bypass
;==================================================================================================
;   Compatibility: WinPE 10 x86 and x64
;==================================================================================================
[Version]
Signature   = "$WINDOWS NT$"
Class       = System
ClassGuid   = {4D36E97d-E325-11CE-BFC1-08002BE10318}
Provider    = OSDeploy
DriverVer   = 10/19/2018,2018.10.19.0

[DefaultInstall] 
AddReg      = AddReg 

[AddReg]
;rootkey,[subkey],[value],[flags],[data]
;0x00000    REG_SZ
;0x00001    REG_BINARY
;0x10000    REG_MULTI_SZ
;0x20000    REG_EXPAND_SZ
;0x10001    REG_DWORD
;0x20001    REG_NONE
HKLM,SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell,ExecutionPolicy,0x00000,"Bypass"
```

{% endcode %}


# WinSE Settings

{% hint style="info" %}
**To open a Command Prompt in WinSE, hold down SHIFT + F10**
{% endhint %}

#### Now that we can use PowerShell, let's get started with some OSD Module fun

## OSDPower High

To speed things up in WinSE, you should enable the High Performance Power Plan.  To do this simply use the following PowerShell Command

```
OSDPower High
```

{% hint style="info" %}
**You can also add the -Verbose parameter for more detailed information**
{% endhint %}

![](/files/-Lq-wf5nI79-R2WhfwUR)

## OSDWinPE -InitializeNetwork

#### By default, WinSE does not have Network initialized, so you can't Ping or run things like Microsoft DaRT Remote Recovery

![](/files/-Lq-yxi2hFaXURrlgByg)

#### To enable WinSE Network Support, use the following PowerShell Command

```
OSDWinPE -InitializeNetwork
```

#### Now Microsoft DaRT Remote Recovery will work, but we have a Firewall Prompt

![](/files/-Lq-zXmFup-703-9QNpo)

## OSDWinPE -DisableFirewall

#### To disable the Firewall, use the following PowerShell Command

```
OSDWinPE -DisableFirewall
```

#### Even though the Firewall gets disabled, still getting a message when launching Remote Recovery

![](/files/-Lq0-1yeRz_8jU2EXt_i)

## OSDWinPE -RemoteRecovery

#### Yes, there is a command for that

```
OSDWinPE -RemoteRecovery
```

#### And there it is ... no prompts and minimized

![](/files/-Lq04mW1Y6hkLV6uzlZV)

![](/files/-Lq051h2B6STuLtWgcLd)


# Import Modules

#### Let's say you include the OSD Module in WinSE, but its an old version, and you want to use an updated version.  Typically you would have to create an updated WinSE

## Add Modules to Media

#### OSD Module has an easy way to add an update.  Simply create a directory called Modules in the root of any Drive and add PowerShell Modules to it that you want to add

![](/files/-Lq07mGDTH3TSEhV56nm)

## OSDWinPE -Modules

#### Using the following PowerShell command will copy the Modules to the PowerShell Modules in System32

```
OSDWinPE -Modules
```

![](/files/-Lq0AS2RP1p2XVXYuBI5)

#### Now the next time you launch PowerShell, the added Modules will be available


# Automation

#### Now let's put this all together in with some Automation

## AutoUnattend.xml

Everything can be added to an AutoUnattend.xml in three separate Commands

### Execution Policy

The Execution Policy must be run first as the OSD Module will not be imported without having this done first.  We know this works properly, so **`-WindowStyle Hidden`** will be used to hide the console

### Add Modules

The second Command will update the OSD Module and add additional Modules.  This must be kept separate so additional Run Commands that are in additional steps will use the updated Modules.  This window will be kept visible and a Pause will be added.  Verbose output is recommended

### Commands

Finally, all the other settings can be put together in the third command.  Again, Verbose and a Pause will help for the test

```
    <settings pass="windowsPE">
        <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <UserData>
                <AcceptEula>true</AcceptEula>
                <ProductKey>
                    <Key>NPPR9-FWDCX-D2C8J-H872K-2YT43</Key>
                    <WillShowUI>Never</WillShowUI>
                </ProductKey>
            </UserData>
            <RunSynchronous>
                <RunSynchronousCommand wcm:action="add">
                    <Order>1</Order>
                    <Description>ExecutionPolicy Bypass</Description>
                    <Path>PowerShell -WindowStyle Hidden -Command "Set-ExecutionPolicy Bypass"</Path>
                </RunSynchronousCommand>
                <RunSynchronousCommand wcm:action="add">
                    <Order>2</Order>
                    <Description>Add PowerShell Modules</Description>
                    <Path>PowerShell -Command "& {OSDWinPE -Modules -Verbose; Pause}"</Path>
                </RunSynchronousCommand>
                <RunSynchronousCommand wcm:action="add">
                    <Order>3</Order>
                    <Description>OSD Settings</Description>
                    <Path>PowerShell -Command "& {OSDPower High -Verbose; OSDWinPE -InitializeNetwork -DisableFirewall -UpdateBootInfo -RemoteRecovery -Verbose; Pause}"</Path>
                </RunSynchronousCommand>
            </RunSynchronous>
        </component>
    </settings>
```

## Execution

#### The first console that we see is to add the Modules.  Press Enter to continue

![](/files/-Lq0EslW6t654haSGsOI)

#### The second one is for the settings.  Press Enter to continue

![](/files/-Lq0FJxIPDB4wXafs4B3)

## Full Automation

#### Once we verify that everything looks good, the Windows can be Hidden, and we can even use PowerShell Transcripts to see how things went.  To fully automate everything, simply use the following commands in the AutoUnattend.xml

```
            <RunSynchronous>
                <RunSynchronousCommand wcm:action="add">
                    <Order>1</Order>
                    <Description>ExecutionPolicy Bypass</Description>
                    <Path>PowerShell -WindowStyle Hidden -Command "Set-ExecutionPolicy Bypass"</Path>
                </RunSynchronousCommand>
                <RunSynchronousCommand wcm:action="add">
                    <Order>2</Order>
                    <Description>Add PowerShell Modules</Description>
                    <Path>PowerShell -WindowStyle Hidden -Command "& {Start-Transcript;OSDWinPE -Modules -Verbose;Stop-Transcript}"</Path>
                </RunSynchronousCommand>
                <RunSynchronousCommand wcm:action="add">
                    <Order>3</Order>
                    <Description>OSD Settings</Description>
                    <Path>PowerShell -WindowStyle Hidden -Command "& {Start-Transcript;OSDPower High -Verbose;OSDWinPE -InitializeNetwork -DisableFirewall -UpdateBootInfo -RemoteRecovery -Verbose;Stop-Transcript}"</Path>
                </RunSynchronousCommand>
            </RunSynchronous>
```

#### And this is the result, looks like nothing happened.  Microsoft DaRT Remote Recovery will be accessible by pressing ALT + TAB

![](/files/-Lq0MRU4CVjggGszAwFn)

#### A closer look shows that everything is set properly

![](/files/-Lq0MnOhhqqYYuhTPMet)

#### PowerShell Transcripts are saved in X:\Sources if you want a closer look

![](/files/-Lq0NFMGDW1imrh4wTtT)


# Release Notes

```
#Update the OSD Module to the latest version
Install-Module OSD -Force
```

## 21.7.21 (2021 July 21)

* Save-WebFile - Resolved issue where URL's with spaces would not download the content. This impacted Dell Driver Packs
* OSDCloud - Resolved issue where some Retail ESD's did not contain 'Home Single Language' so an Index bias was implemented by counting the Indexes to determine if one was missing. This was confirmed in Windows 10 21H1 Retail de-de and impacted Education and Pro editions

## 21.7.20 (2021 July 20)

![](/files/-MfBY-H06P5nyWYWEcJd)

## 21.7.18 (2021 July 18) OSDCloud Any PC ...

... that has drivers in [Microsoft Update Catalog](https://www.catalog.update.microsoft.com/Home.aspx)

### Save-SystemFirmwareUpdate (OSDCloud)

This is the function used to download the Firmware from Microsoft Update Catalog.  This will be added as a Driver to the offline Windows Image and should installed during the next reboot if necessary.  This is handled automatically (no parameter necessary).  Its important to note that Firmware Updates from Microsoft may be 1 version behind (1-3 months) the latest available from the Manufacturer

![](/files/-MewEMC7SJHy9uJHsTd3)

### Save-MsUpCatDriver (OSDCloud)

There are two different execution methods in OSDCloud.  If a Driver Pack for Dell, HP, Lenovo, or Microsoft Surface is found, then **`Save-MsUpCatDriver`** will download and apply Drivers for the Network Adapters only.  If no Driver Pack is found (non-Enterprise devices), then drivers for All Devices are downloaded and applied to the offline Windows Image

![](/files/-MewFjC5aVEh3i_1l8UB)

![](/files/-MewFyEEJO6EfMXLNs-k)

In my testing, this is not always perfect, but having 3 devices out of about a hundred isn't bad.  Finally, the Drivers that were installed were not always the latest.  Enabling drivers in Windows Update when you get Windows 10 or /11 installed should solve all of that

![](/files/-MesMANyzJGbcyB8YveP)

{% hint style="warning" %}
At this time, I have ZERO plans to pull BIOS / Firmware updates from the Vendors (Dell, HP, Lenovo) as this led to quite a bit of complication
{% endhint %}

### Save-MsUpCatDriver (Testing)

In Windows, you can test **`Save-MsUpCatDriver`** to see how this works, just make sure to leave off the **`DestinationDirectory`** parameter so it won't actually perform the download.  This took 20 seconds on my computer in my testing (and 1m40s with the download enabled)

![](/files/-MewGkvmM1oQd3nvOztK)

{% embed url="<https://www.powershellgallery.com/packages/OSD/21.7.18.2>" %}

## 21.7.12 (2021 July 2)

Tweaks to the secret function that I'm not ready to talk about yet

## 21.7.11 (2021 July 11)

```
Get-SystemFirmwareDevice
Get-SystemFirmwareResource
Get-SystemFirmwareUpdate
Save-SystemFirmwareUpdate
Convert-PNPDeviceIDtoGuid
```

## 21.7.2 (2021 July 2)

```
Add-WindowsPackageSSU
```

**`Add-WindowsPackageSSU`** is a new function that will take a combined LCU (CAB or MSU) and extract and install the SSU.  This can be used Online or applied to a mounted WIM

![](/files/-MdxPr4O5n0xrPUUHYWv)

## 21.3.22 - 21.6.22 (OSDCloud Development)

## 21.3.9 (2021 March 9) Patch Tuesday

Some minor tweaks for OSDCloud ... more information coming soon

## 21.3.8 (2021 March 8)

{% content-ref url="/pages/-MVIO2jJ16qb50jOcwLO" %}
[Enable-PEWimPSGallery](/docs/trash/winpe/enable-pewimpsgallery)
{% endcontent-ref %}

{% content-ref url="/pages/-MVINcvdMTv5cseUifu9" %}
[WebPSScript](/docs/trash/webpsscript)
{% endcontent-ref %}

![](/files/-MVIecTPMm4dHnyqL1pw)

## 21.3.4 (2021 March 4)

![](/files/-MV-sgyRLbnIywEufPhB)

{% content-ref url="/pages/-MV-jJmdkgWB8qkeBzxN" %}
[Get-DellCatalogPC](/docs/trash/dell/get-dellcatalogpc)
{% endcontent-ref %}

{% content-ref url="/pages/-MV-jQTiYVIT9bgggj6W" %}
[Get-MyDellBIOS](/docs/trash/dell/get-mydellbios)
{% endcontent-ref %}

{% content-ref url="/pages/-MV-jUU8AQqUPpudTbC0" %}
[Update-MyDellBios](/docs/trash/dell/update-mydellbios)
{% endcontent-ref %}

## 21.2.10 (2021 February 10)

{% content-ref url="/pages/-MTCC1r4eXtYFmz3yupq" %}
[MyBitLocker](/docs/trash/mybitlocker)
{% endcontent-ref %}

![](/files/-MTCP6NF0xI2rb-JjwBz)

{% embed url="<https://www.powershellgallery.com/packages/OSD/21.2.10.1>" %}

## 21.2.9 (2021 February 9)

* Copy-PSModileToWim -new function
* Copy-PSModuleToWindowsImage - new function
* Get-MyWindowsCapability
  * Added Disable WSUS Parameter
  * Resolved issues with Like and Match filtering
* Get-MyWindowsPackage
  * Resolved issues with Like and Match filtering

{% content-ref url="/pages/-MT7BeC\_XTbhQQWWQTgo" %}
[Copy-PSModuleToWim](/docs/trash/psmodule/copy-psmoduletowim)
{% endcontent-ref %}

{% content-ref url="/pages/-MT7Bgm6m9rtWqabKj7O" %}
[Copy-PSModuleToWindowsImage](/docs/trash/psmodule/copy-psmoduletowindowsimage)
{% endcontent-ref %}

![](/files/-MT7EMXn7Vke_IjkrY1_)

## 21.2.8 (2021 February 8)

READ THE LINKS :)

![](/files/-MT2Jk7sUX9lXaW5cFV4)

{% content-ref url="/pages/-MT3XJabD8l3Vwc2tKXR" %}
[Get-MyWindowsCapability](/docs/trash/dism/get-mywindowscapability)
{% endcontent-ref %}

{% content-ref url="/pages/-MT3XwhgDcTJbc6z5pS\_" %}
[Get-MyWindowsPackage](/docs/trash/dism/get-mywindowspackage)
{% endcontent-ref %}

{% embed url="<https://www.osdeploy.com/blog/2021/windowscapability-and-windowspackage>" %}

{% embed url="<https://www.powershellgallery.com/packages/OSD/21.2.8.1>" %}

## 21.2.3 (2021 February 3)

* **Get-ComObjects**
  * List of (mostly all) of the system ComObjects
* **Get-ComObjMicrosoftUpdateAutoUpdate**
  * (New-Object -ComObject Microsoft.Update.AutoUpdate).Settings
* **Get-ComObjMicrosoftUpdateInstaller**
  * New-Object -ComObject Microsoft.Update.Installer
* **Get-ComObjMicrosoftUpdateServiceManager**
  * (New-Object -ComObject Microsoft.Update.ServiceManager).Services
* **Get-MyComputerManufacturer**
  * Returns the Computer Manufacturer
* **Get-MyComputerModel**
  * Returns the Computer Model
* **Get-MyBiosSerialNumber**
  * Returns the Computer Serial Number
* **Get-MyDefaultAUService**
  * Returns the default AutoUpdate repo, thanks Ben Whitmore!

{% embed url="<https://www.powershellgallery.com/packages/OSD/21.2.3.1>" %}

## 21.2.2 (2021 February 2)

10 new functions and 1 renamed function

* **Get-CIMVideoControllerResolution**
  * Returns the CIM\_VideoControllerResolution Properties for the Primary Screen
* **Get-DisplayAllScreens**
  * Returns \[System.Windows.Forms.Screen]::AllScreens
* **Get-DisplayPrimaryBitmapSize**
  * Calulates the Bitmap Screen Size (PrimaryMonitorSize x ScreenScaling)
* **Get-DisplayPrimaryMonitorSize**
  * Returns \[System.Windows.Forms.SystemInformation]::PrimaryMonitorSize
* **Get-DisplayPrimaryScaling**
  * Returns the Primary Screen Scaling in Percent
* **Get-DisplayVirtualScreen**
  * Returns \[System.Windows.Forms.SystemInformation]::VirtualScreen
* **Set-DisRes**
  * Sets the Primary Display Screen Resolution
* **Copy-ModuleToFolder**
  * Remamed from Copy-Module as PowerShellGet had a hidden function with the same name
  * Copies a PowerShell Module to a specified Destination
* **Get-ScreenPNG**
  * Takes a screeshot
* **Set-ClipboardScreenshot**
  * Sets a Screenshot of the Primary Screen on the Clipboard
    * Use Save-ClipboardImage to save the PNG
* **Save-ClipboardImage**
  * Saves the Clipboard Image as a file
  * PNG extension is recommended

{% embed url="<https://www.powershellgallery.com/packages/OSD/21.2.2.1>" %}

## 21.2.1 (2021 February 1)

Two new functions were added to make it easier to set the PowerShell Execution Policy for a WIM or a mounted Windows Image

* Set-WIMExecutionPolicy
* Set-WindowsImageExecutionPolicy

{% content-ref url="/pages/-MSRS92MTxd5p1Tu37fs" %}
[Set-WimExecutionPolicy](/docs/trash/dism/set-wimexecutionpolicy)
{% endcontent-ref %}

{% content-ref url="/pages/-MSRSE1uTe7\_6-NttkHm" %}
[Set-WindowsImageExecutionPolicy](/docs/trash/dism/set-windowsimageexecutionpolicy)
{% endcontent-ref %}

{% embed url="<https://www.powershellgallery.com/packages/OSD/21.2.1.1>" %}

## 21.1.31 (2021 January 31)

* Copy-Module
  * Removed the WinPE option as that was all wrong
* Get-VidConRes
  * This is for testing only right now

## 21.1.30 (2021 January 30)

{% content-ref url="/pages/-MSH9AB\_d2GEDhj7uhw-" %}
[Copy-PSModuleToFolder](/docs/trash/psmodule/copy-psmoduletofolder)
{% endcontent-ref %}

{% embed url="<https://www.powershellgallery.com/packages/OSD/21.1.30.1>" %}

## 21.1.29 (2021 January 29)

* **Backup-DiskToFFU**
  * Create a full Disk Image in WinPE
* Get-DiskIsBoot
  * Gets the Disk containing the BOOT partition
* Get-DiskIsSystem
  * Gets the Disk containing the SYSTEM partition
* Get-DiskToBackup
  * Gets Disks that can be backed up
  * USB Drives are excluded
  * Boot Drives are excluded
* Get-EZComputerManufacturer
  * Returns a simple Computer Manufacturer
  * Names are standardized (i.e. Dell Inc. returns as Dell)
* Get-EZComputerModel
  * Returns a Computer Model
  * No more hunting for Lenovo hide and seek games
* Get-EZComputerSerialNumber
  * Returns the Computer Serial Number

![](/files/-MSEZOHuXpKCwqes_slE)

{% embed url="<https://www.powershellgallery.com/packages/OSD/21.1.29.1>" %}

## 21.1.28 (2021 January 28)

Backup-ToFFU Preview

## 20.8.19 (2020 August 19)

Updated OSDDrivers for Nvidia and AMD

## 20.2.26 (2020 February 26)

Modified OSDDrivers for Nvidia and AMD

## 19.12.19 (2019 December 19)

* **WindowsImageOSD is now complete.  The renames align more with existing Cmdlets**
  * **Dismount-WindowsImageOSD**
    * New Function
    * The major different with Dismount-WindowsImage is when a Path is not specified, all mounted Windows Images are addressed, so you can easily dismount everything
  * **Edit-WindowsImageOSD**
    * New Function
    * CleanupImage parameter supports Analyze, Cleanup, CleanupResetBase (Offline only)
    * GridRemoveAppx parameter displays a GridView to easily select Appx Packages from all User Profiles (Online only)
    * GridRemoveAppxPP parameter displays a GridView to easily select Appx Provisioned Packages for Removal (Online and Offline)
    * RemoveAppx parameter removes Appx Packages by string match to PackageName (Online only)
    * RemoveAppxPP parameter removes Appx Provisioned Packages by string match to PackageName (Online and Offline)
    * Path parameter is optional and if omitted, options will be applied to all Mounted Windows Images
* **Mount-WindowsImageOSD**
  * Rename of Mount-OSDWindowsImage.  Old name has been aliased
* **Update-WindowsImageOSD**
  * Rename of Update-OSDWindowsImage.  Old name has been aliased

![](/files/-LwUtYVIuN6aJ8nIQtWv)

* **Get-SessionsXml**
  * Rename of Get-OSDSessions.  Old name has been aliased

{% embed url="<https://www.powershellgallery.com/packages/OSD/19.12.19.0>" %}

## 19.12.9 (2019 December 9)

* **Initialize-DiskOSD**
  * New function
  * Automatically initializes RAW Disks with proper GPT or MBR Partition Style
* **Get-OSDDriver**
  * DellModel updated to remove empty objects

{% embed url="<https://www.powershellgallery.com/packages/OSD/19.12.9.0>" %}

## 19.12.6 (2019 December 6)

* **Get-OSDDriver**
  * **New Function**
  * **Returns download links for a selected Driver Groups**
    * AmdDisplay
    * DellFamily - Provided as a convenience, but really you should be using DellModel Drivers
    * DellModel
    * HpModel
    * IntelDisplay
    * IntelWireless
    * NvidiaDisplay
* **Get-OSDDriverWmiQ**
  * **New Function**
  * **Returns a Computer Model WMI Query that can be used in Task Sequences**
* **Save-OSDDownload**
  * Created SourceUrl parameter alias DriverUrl to easily work with Get-OSDDriver
* **Update-OSDWindowsImage**
  * Added more detailed Get-Help information relating to the Update parameter
  * Modified Warning Messages

![](/files/-LvRnXfA_hE4tiv0FxfV)

{% embed url="<https://www.powershellgallery.com/packages/OSD/19.12.6.3>" %}

## 19.11.22 (2019 November 22)

#### OSDWindowsImage is released

{% content-ref url="/pages/-LuGgbcacNJMMzXFx5Jk" %}
[OSDWindowsImage](/docs/osdwindowsimage)
{% endcontent-ref %}

{% embed url="<https://www.powershellgallery.com/packages/OSD/19.11.22.0>" %}

## 19.11.20 (2019 November 20)

* Get-OSD
  * Added Update-OSDWindowsImage information
* Get-OSDSessions
  * Added pipeline support
  * Path parameter now supports a mounted Windows Image or a specified Sessions.xml
  * Added Verbose Path information
* Get-RegKeyWinCurVer
  * Added pipeline support
  * Added Verbose Path information
* Update-OSDWindowsImage
  * Added Comment Based Help

{% embed url="<https://www.powershellgallery.com/packages/OSD/19.11.20.0>" %}


# Trash


# Adk


# Edit-ADKwinpe.wim

This really is a great function if you are looking to speed things up with ADK's WinPE.wim.  I end up ALWAYS adding PowerShell to WinPE and that takes time with .NET and all the other packages

What this function will do is back up the existing ADK winpe.wim, and modify the amd64 winpe.wim with the following changes

* All the cool ADK Packages for PowerShell support
* cURL.exe will be added copied (if you have it in your host OS)
* PowerShell ExecutionPolicy will be set to Bypass
* Volatile Paths will be added (APPDATA, LOCALAPPDATA)
  * Required for PackageManagement
* PackageManagement
  * Required for PowerShell Gallery
* PowerShellGet
  * Required for PowerShell Gallery

I made sure to add a TimeSpan to show how much time you will save every time you create WinPE going forward.  In my case, 4.5 minutes!  Now before you say anything, yes it is ugly with everything VERBOSE, but I believe that if you are editing your master winpe.wim, you better make sure you know what is happening to it

```
PS C:\WINDOWS\system32> Edit-ADKWinPE.wim

VERBOSE: Performing the operation "Copy File" on target "Item: C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\en-us\winpe.wim Destination: C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows
Preinstallation Environment\amd64\en-us\winpe.bak".
VERBOSE: C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\en-us\winpe.wim
VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-WMI.cab

Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-WMI_en-us.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-HTA.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-HTA_en-us.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-NetFx.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-NetFx_en-us.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-Scripting.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-Scripting_en-us.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-PowerShell.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-PowerShell_en-us.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-SecureStartup.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-SecureStartup_en-us.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-DismCmdlets.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-DismCmdlets_en-us.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-Dot3Svc.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-Dot3Svc_en-us.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-EnhancedStorage.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-EnhancedStorage_en-us.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-FMAPI.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-GamingPeripherals.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-PPPoE.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-PPPoE_en-us.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-PlatformId.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-PmemCmdlets.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-PmemCmdlets_en-us.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-RNDIS.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-RNDIS_en-us.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-SecureBootCmdlets.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-StorageWMI.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-StorageWMI_en-us.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-WDS-Tools.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Target Image Version 10.0.19041.1
VERBOSE: Successfully added package C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-WDS-Tools_en-us.cab
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Adding curl.exe to C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396

VERBOSE: Setting PowerShell ExecutionPolicy to Bypass in C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
VERBOSE: Path: C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396

LastWriteTime : 3/15/2021 9:19:50 PM
Length        : 0
Name          : Set-ExecutionPolicy.inf

VERBOSE: Target Image Version 10.0.19041.1
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False


MountPath   : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
ImagePath   : C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\en-us\winpe.wim
ImageIndex  : 1
MountMode   : ReadWrite
MountStatus : Ok

VERBOSE: Enabling PowerShell Gallery support in C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
VERBOSE: Path: C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396

LastWriteTime : 3/15/2021 9:19:51 PM
Length        : 0
Name          : Set-WinPEEnvironment.inf

VERBOSE: Target Image Version 10.0.19041.1
Path          : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
Online        : False
RestartNeeded : False

VERBOSE: Saving PackageManagement to C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396\Program Files\WindowsPowerShell\Modules
VERBOSE: Populating RepositorySourceLocation property for module PackageManagement.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PackageManagement\1.4.7\PackageManagement.psm1'.
VERBOSE: Populating RepositorySourceLocation property for module PackageManagement.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PackageManagement\1.4.5\PackageManagement.psm1'.
VERBOSE: Populating RepositorySourceLocation property for module PackageManagement.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PackageManagement\1.4.4\PackageManagement.psm1'.
VERBOSE: Populating RepositorySourceLocation property for module PackageManagement.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PackageManagement\1.1.1.0\PackageManagement.psm1'.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PackageManagement\1.4.7\PackageManagement.psd1'.
VERBOSE: Loading 'FormatsToProcess' from path 'C:\Program Files\WindowsPowerShell\Modules\PackageManagement\1.4.7\PackageManagement.format.ps1xml'.
VERBOSE: Populating RepositorySourceLocation property for module PackageManagement.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PackageManagement\1.4.7\PackageManagement.psm1'.
VERBOSE: Exporting cmdlet 'Find-Package'.
VERBOSE: Exporting cmdlet 'Find-PackageProvider'.
VERBOSE: Exporting cmdlet 'Get-Package'.
VERBOSE: Exporting cmdlet 'Get-PackageProvider'.
VERBOSE: Exporting cmdlet 'Get-PackageSource'.
VERBOSE: Exporting cmdlet 'Import-PackageProvider'.
VERBOSE: Exporting cmdlet 'Install-Package'.
VERBOSE: Exporting cmdlet 'Install-PackageProvider'.
VERBOSE: Exporting cmdlet 'Register-PackageSource'.
VERBOSE: Exporting cmdlet 'Save-Package'.
VERBOSE: Exporting cmdlet 'Set-PackageSource'.
VERBOSE: Exporting cmdlet 'Uninstall-Package'.
VERBOSE: Exporting cmdlet 'Unregister-PackageSource'.
VERBOSE: Importing cmdlet 'Find-Package'.
VERBOSE: Importing cmdlet 'Find-PackageProvider'.
VERBOSE: Importing cmdlet 'Get-Package'.
VERBOSE: Importing cmdlet 'Get-PackageProvider'.
VERBOSE: Importing cmdlet 'Get-PackageSource'.
VERBOSE: Importing cmdlet 'Import-PackageProvider'.
VERBOSE: Importing cmdlet 'Install-Package'.
VERBOSE: Importing cmdlet 'Install-PackageProvider'.
VERBOSE: Importing cmdlet 'Register-PackageSource'.
VERBOSE: Importing cmdlet 'Save-Package'.
VERBOSE: Importing cmdlet 'Set-PackageSource'.
VERBOSE: Importing cmdlet 'Uninstall-Package'.
VERBOSE: Importing cmdlet 'Unregister-PackageSource'.
VERBOSE: Saving PowerShellGet to C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396\Program Files\WindowsPowerShell\Modules

MountPath   : C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
ImagePath   : C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\en-us\winpe.wim
ImageIndex  : 1
MountMode   : ReadWrite
MountStatus : Ok

VERBOSE: Path: C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396
VERBOSE: Performing the operation "Dismount-MyWindowsImage -Save" on target "C:\Users\SeguraOSD\AppData\Local\Temp\Mount1574955396".
=========================================================================
2021-03-15-212107 Edit-AdkWinPE.wim Completed in 04 minutes 33 seconds
```

Now with the edited winpe.wim it shaves off time considerably going forward with anything, MDT, MEM CM, or even other scripts.  In the case below I was able to all of this in 1m:32s !

* Copies the winpe.wim
* Mounts winpe.wim
* Adds the same packages as Edit-AdkWinPE.wim ... so it basically skips through the process
* Dismounts winpe.wim
* Creates an ISO

![](/files/-MVsuON1ajarGG9KGQhA)


# Get-ADKpaths

This simple function gets the most common Adk Paths that can be used in other functions, like creating an ISO

![](/files/-MVtEDYCnsRMFl6E5HU8)


# New-ADK.iso

{% hint style="warning" %}
I have no clue if this will work on x86, nor do I have plans to test.  Sorry!
{% endhint %}

As long as you have ADK and give it a path that's bootable, it will create an ISO for you.  And it can even handle removing the 'Press any key to boot from CD or DVD......'

![](/files/-MVttFYAMVjC2-pkP0rd)


# New-ADKcopype

Another simple function that does what this ADK cmd file does.  Nothing more, nothing less.

![](/files/-MVtu5CB7Zf7MWWOlZZc)


# Appx

## Remove-AppxOnline

This function will remove an Appx Package and Appx Provisioned Package given a matching string

![](/files/-MSa9ne5xYzTaLxVbvIH)


# Block

Block functions are used to take the place of different stops that I place in my scripts

![](/files/-MWV-zlxlJEMglCBVUZI)

## Example

For example, I have a function that needs the following requirements

* Runs in Full OS, not WinPE
* Requires Admin Rights
* Requires Curl.exe

In my code,  I' would do something like this

```
    #=======================================================================
    #	Require WinOS
    #=======================================================================
    if ((Get-OSDGather -Property IsWinPE)) {
        Write-Warning "$($MyInvocation.MyCommand) cannot be run from WinPE"
        Break
    }
    #=======================================================================
    #   Require Admin Rights
    #=======================================================================
    if ((Get-OSDGather -Property IsAdmin) -eq $false) {
        Write-Warning "$($MyInvocation.MyCommand) requires Admin Rights ELEVATED"
        Break
    }
    #=======================================================================
    #   Require cURL
    #=======================================================================
    if (-NOT (Test-Path "$env:SystemRoot\System32\curl.exe")) {
        Write-Warning "$($MyInvocation.MyCommand) could not find $env:SystemRoot\System32\curl.exe"
        Write-Warning "Get a newer Windows version!"
        Break
    }
    #=======================================================================
```

By taking these Blocks into separate functions, I can easily add this to my PowerShell script and greatly simplify things as well as ensuring consistency

```
Import-Module OSD
Block-WinPE
Block-StandardUser
Block-NoCurl
```

## Real World Example

In the real world, I have a function that has these blocks in place

![](/files/-MWUzKFseiHD-lEbN9wq)

And when running the function in PowerShell as a Standard User, I receive the following:

![](/files/-MWUz0zcxoXrKPvvw_nf)

## The Code

This is what the code of a Block will do.  By default, a Warning with a Timestamp and calling Function will be displayed, followed by a Break.  These can be adjusted with two Parameters

#### -Warn

Provides a Warning without a Break

#### -Pause

Adds a Press Any Key to continue

![](/files/-MWV-I8hSj2gqzPjGFXF)


# CloudDriver

## Save-WinPECloudDriver


# Dell


# Get-DellCatalogPC

Don't do this.  You will get an endless list of Dell updates for Applications, BIOS, Drivers, and Firmware

![](/files/-MV-oNe45dVjeNokl6YR)

Ok, this is a little better, but not by much

![](/files/-MV-p5hNdibHw6yjF18m)

## -Component

This will weed things down a bit.  You can choose Application, BIOS, Driver, or Firmware ... but it is still not that great

![](/files/-MV-paWGYJwMjyskIY10)

## -Compatible

If you have a Dell computer, you can filter things even more.  Here's all my Dell Video Drivers!

![](/files/-MV-qEmQLL4EjM9fdlxB)


# Get-MyDellBIOS

This really just takes the Dell CatalogPC.xml and returns the BIOS Update for the running system.  It's just a quick way to do the following command

```
Get-DellCatalogPC -Component BIOS -Compatible
```

![](/files/-MV-kV_kbuhIqaSpyFPb)


# Update-MyDellBios

{% hint style="danger" %}
Requires Admin Rights
{% endhint %}

This will take **`Get-MyDellBIOS`** function one step further and Download and Install the update.  Without any switches its pretty harmless.  The computer is checked for BitLocker before the update and it is set to Suspend for 1 reboot automatically

![](/files/-MV-l5E6DBYoOwKIo2-T)

## -Silent

This is scary stuff.  It will actually perform the BIOS Update without the GUI.  Does not Reboot.  You should notice a change when you Shutdown though

![](/files/-MV-mFLxEcyFmnX4UNMZ)

## -Reboot

This will take things one step further.  After the Update is complete, the system will reboot automatically.  Here is the proper command line

```
Update-MyDellBios -Silent -Reboot
```

## Logs

This will log automatically to the following path.  There is no option to change or redirect at this time

```
$env:TEMP\Update-MyDellBios.log
```


# Disk

OSD 21.2.22+

```
PS C:\> Get-Command -Module OSD -Noun *Disk*,*Volume*

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Function        Backup-DiskToFFU                                   21.3.3.1   OSD
Function        Clear-LocalDisk                                    21.3.3.1   OSD
Function        Clear-USBDisk                                      21.3.3.1   OSD
Function        Get-LocalDisk                                      21.3.3.1   OSD
Function        Get-OSDDisk                                        21.3.3.1   OSD
Function        Get-USBDisk                                        21.3.3.1   OSD
Function        Get-USBVolume                                      21.3.3.1   OSD
```

{% content-ref url="/pages/-MSRP5Qrts85a8A\_atAp" %}
[Backup-Disk.ffu](/docs/trash/disk/backup-disktoffu)
{% endcontent-ref %}

{% content-ref url="/pages/-MU7mEcbzGnQf\_n16zeA" %}
[Clear-LocalDisk](/docs/trash/disk/clear-localdisk)
{% endcontent-ref %}

{% content-ref url="/pages/-MUCOElJA2LKcznsP3sM" %}
[Clear-USBDisk](/docs/trash/disk/clear-usbdisk)
{% endcontent-ref %}

{% content-ref url="/pages/-MUCOhYa-WwuMX5LSVMf" %}
[Get-LocalDisk](/docs/trash/disk/get-localdisk)
{% endcontent-ref %}

{% content-ref url="/pages/-MU7mBFtAHuJSI0LBVTj" %}
[Get-OSDDisk](/docs/trash/disk/get-osddisk)
{% endcontent-ref %}

{% content-ref url="/pages/-MUCOl3TPWiglT8TDLc8" %}
[Get-USBDisk](/docs/trash/disk/get-usbdisk)
{% endcontent-ref %}

{% content-ref url="/pages/-MU7mGWYM3XsQf\_oBZQG" %}
[New-OSDisk](/docs/trash/disk/new-osdisk)
{% endcontent-ref %}


# Backup-Disk.ffu

March 22, 2021

This function is intended to be run in WinPE and will capture an FFU Disk Image.

## Requirements

* One or more Local Disks
* DataStore to save the Local Disk FFU
  * Secondary Disk
  * Network Share
  * USB Disk
    * Make sure you have a fast one.  This is not recommended

## Usage

There are no parameters to this function

### Source Disk

You will be prompted to select a Local Disk to backup if you have more than one disk, otherwise there is no selection.

### DataStore

You will always be prompted to select a DataStore.  The path is generated automatically based on the Computer Manufacturer, Model, and Serial Number

### Execution

Just type in FFU to start the process.  This may take some time

![](/files/-MWSOixsr8uOKVEI8gJq)

{% embed url="<https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/deploy-windows-using-full-flash-update--ffu>" %}


# Clear-LocalDisk

OSD 21.2.22+

This function is intended to run from WinPE and is ideally used to clear all Local Disks returned by Get-LocalDisk.  I use this to clear all Local Disks (OS and DATA) before an OS Deployment

## Getting Started

I strongly recommend running it without any parameters.  By default, the following information is presented

```
Clear-LocalDisk
```

1. -Verbose is enabled
2. Detected UEFI and PartitionStyle are displayed
3. Get-Help Clear-LocalDisk
4. Get-LocalDisk | Format-Table is displayed

![](/files/-MUCHEkNWvwj_TDU2wm2)

## -Force

When the `-Force` parameter is used, things are a little different

```
Clear-LocalDisk -Force
```

1. Get-LocalDisk | Format-Table is displayed
2. Confirm for each LocalDisk
3. Get-LocalDisk | Format-Table is updated and displayed
   1. PartitionStyle = RAW
   2. NumberofPartitions = 0

![](/files/-MUCHXrHDmFpdv6qz7jZ)

## -Force -Confirm:$false

This leaves no room for error as there are no confirmation prompts

```
Clear-LocalDisk -Force -Confirm:$false
```

![](/files/-MUCI_RlrMSO1YdTZRnk)

## -Initialize

Adding this parameter will initialize the Disk in either GPT or MBR.  If the system is UEFI, then GPT is automatically enabled

![](/files/-MUCNAN3IWdbJ9QhGXj1)

## -PartitionStyle

Using this parameter you can override the automatic selection of the PartitionStyle.  In this example, a UEFI with GPT would have been automatically selected, but specifying `-PartitionStyle MBR` overrode that

![](/files/-MUCNG7u6nLW0GzPi1Ut)


# Clear-USBDisk

OSD 21.2.22+

This function will clear the USB Drives.  You can optionally **`Initialize`** and specify a **`PartitionStyle`**.  The **`-Force`** parameter is required to actually do the work.  When this parameter is not used, Get-Help will be displayed, as well as the returned **`Get-USBDisk`** results

![](/files/-MV2W2Aedgkfweil5cp2)

You will be prompted to confirm Clear-Disk for each USB Drive. To fully automate things, use the following command

```
Clear-LocalDisk -Force -Confirm:$false
```


# Get-LocalDisk

OSD 21.2.22+

This function easily lets you filter out the Local from the Removable disks.  It is also a shortcut for the following command

```
Get-OSDDisk -BusTypeNot 'File Backed Virtual',MAX,'Microsoft Reserved',SD,USB,Virtual
```

![](/files/-MV2RkvViUXiIDnamRNg)

{% content-ref url="/pages/-MU7mBFtAHuJSI0LBVTj" %}
[Get-OSDDisk](/docs/trash/disk/get-osddisk)
{% endcontent-ref %}

{% content-ref url="/pages/-MUCOl3TPWiglT8TDLc8" %}
[Get-USBDisk](/docs/trash/disk/get-usbdisk)
{% endcontent-ref %}

## Parameters

```
PS C:\> Get-Help Get-LocalDisk -Parameter *

-Number <UInt32>
    Specifies the disk number for which to get the associated Disk object
    Alias = Disk, DiskNumber

    Required?                    false
    Position?                    1
    Default value                0
    Accept pipeline input?       false
    Accept wildcard characters?  false


-BootFromDisk <Boolean>
    Returns Disk results based BootFromDisk property
    PS> Get-OSDDisk -BootFromDisk:$true
    PS> Get-OSDDisk -BootFromDisk:$false

    Required?                    false
    Position?                    2
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false


-IsBoot <Boolean>
    Returns Disk results based IsBoot property
    PS> Get-OSDDisk -IsBoot:$true
    PS> Get-OSDDisk -IsBoot:$false

    Required?                    false
    Position?                    3
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false


-IsReadOnly <Boolean>
    Returns Disk results based IsReadOnly property
    PS> Get-OSDDisk -IsReadOnly:$true
    PS> Get-OSDDisk -IsReadOnly:$false

    Required?                    false
    Position?                    4
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false


-IsSystem <Boolean>
    Returns Disk results based IsSystem property
    PS> Get-OSDDisk -IsSystem:$true
    PS> Get-OSDDisk -IsSystem:$false

    Required?                    false
    Position?                    5
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false


-BusType <String[]>
    Returns Disk results in BusType values
    Values = '1394','ATA','ATAPI','Fibre Channel','File Backed Virtual','iSCSI','MMC','MAX','Microsoft Reserved','NVMe','RAID','SAS','SATA','SCSI','SD','SSA','Storage Spaces','USB','Virtual'
    PS> Get-OSDDisk -BusType NVMe
    PS> Get-OSDDisk -BusType NVMe,SAS

    Required?                    false
    Position?                    6
    Default value
    Accept pipeline input?       false
    Accept wildcard characters?  false


-BusTypeNot <String[]>
    Returns Disk results notin BusType values
    Values = '1394','ATA','ATAPI','Fibre Channel','File Backed Virtual','iSCSI','MMC','MAX','Microsoft Reserved','NVMe','RAID','SAS','SATA','SCSI','SD','SSA','Storage Spaces','USB','Virtual'
    PS> Get-OSDDisk -BusTypeNot USB
    PS> Get-OSDDisk -BusTypeNot USB,Virtual

    Required?                    false
    Position?                    7
    Default value
    Accept pipeline input?       false
    Accept wildcard characters?  false


-MediaType <String[]>
    Returns Disk results in MediaType values
    Values = 'SSD','HDD','SCM','Unspecified'
    PS> Get-OSDDisk -MediaType SSD

    Required?                    false
    Position?                    8
    Default value
    Accept pipeline input?       false
    Accept wildcard characters?  false


-MediaTypeNot <String[]>
    Returns Disk results notin MediaType values
    Values = 'SSD','HDD','SCM','Unspecified'
    PS> Get-OSDDisk -MediaTypeNot HDD

    Required?                    false
    Position?                    9
    Default value
    Accept pipeline input?       false
    Accept wildcard characters?  false


-PartitionStyle <String[]>
    Returns Disk results in PartitionStyle values
    Values = 'GPT','MBR','RAW')
    PS> Get-OSDDisk -PartitionStyle GPT

    Required?                    false
    Position?                    10
    Default value
    Accept pipeline input?       false
    Accept wildcard characters?  false


-PartitionStyleNot <String[]>
    Returns Disk results notin PartitionStyle values
    Values = 'GPT','MBR','RAW')
    PS> Get-OSDDisk -PartitionStyleNot RAW

    Required?                    false
    Position?                    11
    Default value
    Accept pipeline input?       false
    Accept wildcard characters?  false
```


# Get-OSDDisk

OSD 21.2.22+

This function is mostly identical to **`Get-Disk`**, although it adds MediaType (from **`Get-PhysicalDisk`**).  This is useful in determining a HDD vs SSD

![](/files/-MV2REmjQnEpZ2XQG7XJ)

## Parameters

```
PS C:\> Get-Help Get-OSDDisk -Parameter *

-Number <UInt32>
    Specifies the disk number for which to get the associated Disk object
    Alias = Disk, DiskNumber
    
    Required?                    false
    Position?                    1
    Default value                0
    Accept pipeline input?       false
    Accept wildcard characters?  false
    

-BootFromDisk <Boolean>
    Returns Disk results based BootFromDisk property
    PS> Get-OSDDisk -BootFromDisk:$true
    PS> Get-OSDDisk -BootFromDisk:$false
    
    Required?                    false
    Position?                    2
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false
    

-IsBoot <Boolean>
    Returns Disk results based IsBoot property
    PS> Get-OSDDisk -IsBoot:$true
    PS> Get-OSDDisk -IsBoot:$false
    
    Required?                    false
    Position?                    3
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false
    

-IsReadOnly <Boolean>
    Returns Disk results based IsReadOnly property
    PS> Get-OSDDisk -IsReadOnly:$true
    PS> Get-OSDDisk -IsReadOnly:$false
    
    Required?                    false
    Position?                    4
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false
    

-IsSystem <Boolean>
    Returns Disk results based IsSystem property
    PS> Get-OSDDisk -IsSystem:$true
    PS> Get-OSDDisk -IsSystem:$false
    
    Required?                    false
    Position?                    5
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false
    

-BusType <String[]>
    Returns Disk results in BusType values
    Values = '1394','ATA','ATAPI','Fibre Channel','File Backed Virtual','iSCSI','MMC','MAX','Microsoft 
    Reserved','NVMe','RAID','SAS','SATA','SCSI','SD','SSA','Storage Spaces','USB','Virtual'
    PS> Get-OSDDisk -BusType NVMe
    PS> Get-OSDDisk -BusType NVMe,SAS
    
    Required?                    false
    Position?                    6
    Default value                
    Accept pipeline input?       false
    Accept wildcard characters?  false
    
    
-BusTypeNot <String[]>
    Returns Disk results notin BusType values
    Values = '1394','ATA','ATAPI','Fibre Channel','File Backed Virtual','iSCSI','MMC','MAX','Microsoft 
    Reserved','NVMe','RAID','SAS','SATA','SCSI','SD','SSA','Storage Spaces','USB','Virtual'
    PS> Get-OSDDisk -BusTypeNot USB
    PS> Get-OSDDisk -BusTypeNot USB,Virtual
    

-MediaType <String[]>
    Returns Disk results in MediaType values
    Values = 'SSD','HDD','SCM','Unspecified'
    PS> Get-OSDDisk -MediaType SSD
    
    Required?                    false
    Position?                    8
    Default value                
    Accept pipeline input?       false
    Accept wildcard characters?  false
    

-MediaTypeNot <String[]>
    Returns Disk results notin MediaType values
    Values = 'SSD','HDD','SCM','Unspecified'
    PS> Get-OSDDisk -MediaTypeNot HDD
    
    Required?                    false
    Position?                    9
    Default value                
    Accept pipeline input?       false
    Accept wildcard characters?  false
    

-PartitionStyle <String[]>
    Returns Disk results in PartitionStyle values
    Values = 'GPT','MBR','RAW'
    PS> Get-OSDDisk -PartitionStyle GPT
    
    Required?                    false
    Position?                    10
    Default value                
    Accept pipeline input?       false
    Accept wildcard characters?  false
    

-PartitionStyleNot <String[]>
    Returns Disk results notin PartitionStyle values
    Values = 'GPT','MBR','RAW'
    PS> Get-OSDDisk -PartitionStyleNot RAW
    
    Required?                    false
    Position?                    11
    Default value                
    Accept pipeline input?       false
    Accept wildcard characters?  false
```


# Get-USBDisk

OSD 21.2.22+

This easily converts **`Get-OSDDisk`** to return only drives with a USB BusType.  Keep in mind this is USB only, and I expect there should be a `Get-RemovableDisk` to include SD or MMC types

```
Get-OSDDisk -BusType USB
```

![](/files/-MV2UUHgzmd5F8fBJEER)

## Get-Help

```
PS C:\> Get-Help Get-USBDisk -Detailed

NAME
    Get-USBDisk
    
SYNOPSIS
    Returns Get-Disk + MediaType with BusType USB
    
    
SYNTAX
    Get-USBDisk [[-Number] <UInt32>] [<CommonParameters>]
    
    
DESCRIPTION
    Returns Get-Disk + MediaType with BusType USB
    

PARAMETERS
    -Number <UInt32>
        Specifies the disk number for which to get the associated Disk object
        Alias = Disk, DiskNumber
        
    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see 
        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). 
    
REMARKS
    To see the examples, type: "get-help Get-USBDisk -examples".
    For more information, type: "get-help Get-USBDisk -detailed".
    For technical information, type: "get-help Get-USBDisk -full".
    For online help, type: "get-help Get-USBDisk -online"
```


# New-OSDisk

OSD 21.2.22+


# Old Version

## Get-Help -Full

```
PS C:\> Get-Help -Full New-OSDDisk

NAME
    New-OSDDisk
    
SYNOPSIS
    Creates System | OS | Recovery Partitions for MBR or UEFI Drives in WinPE
    
    
SYNTAX
    New-OSDDisk [[-Title] <String>] [[-DiskNumber] <Int32>] [[-LabelSystem] <String>] [[-LabelWindows] <String>] [[-LabelRecovery] <String>] [[-SizeSystemMbr] <UInt64>] [[-SizeSystemGpt] <UInt64>] [[-SizeMSR] 
    <UInt64>] [[-SizeRecovery] <UInt64>] [-SkipRecoveryPartition] [-Force] [<CommonParameters>]
    
    
DESCRIPTION
    Creates System | OS | Recovery Partitions for MBR or UEFI Drives in WinPE
    

PARAMETERS
    -Title <String>
        Title displayed during script execution
        Default = New-OSDDisk
        Alias = T
        
        Required?                    false
        Position?                    1
        Default value                New-OSDDisk
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -DiskNumber <Int32>
        Fixed Disk Number
        Alias = Disk, Number
        
        Required?                    false
        Position?                    2
        Default value                0
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -LabelSystem <String>
        Drive Label of the System Partition
        Default = System
        Alias = LS, LabelS
        
        Required?                    false
        Position?                    3
        Default value                System
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -LabelWindows <String>
        Drive Label of the Windows Partition
        Default = OS
        Alias = LW, LabelW
        
        Required?                    false
        Position?                    4
        Default value                OS
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -LabelRecovery <String>
        Drive Label of the Recovery Partition
        Default = Recovery
        Alias = LR, LabelR
        
        Required?                    false
        Position?                    5
        Default value                Recovery
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -SizeSystemMbr <UInt64>
        System Partition size for BIOS MBR based Computers
        Default = 260MB
        Range = 100MB - 3000MB (3GB)
        Alias = SSM, Mbr, SystemM
        
        Required?                    false
        Position?                    6
        Default value                272629760
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -SizeSystemGpt <UInt64>
        System Partition size for UEFI GPT based Computers
        Default = 260MB
        Range = 100MB - 3000MB (3GB)
        Alias = SSG, Efi, SystemG
        
        Required?                    false
        Position?                    7
        Default value                272629760
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -SizeMSR <UInt64>
        MSR Partition size
        Default = 16MB
        Range = 16MB - 128MB
        Alias = MSR
        
        Required?                    false
        Position?                    8
        Default value                16777216
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -SizeRecovery <UInt64>
        Size of the Recovery Partition
        Default = 990MB
        Range = 350MB - 80000MB (80GB)
        Alias = SR, Recovery
        
        Required?                    false
        Position?                    9
        Default value                1038090240
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -SkipRecoveryPartition [<SwitchParameter>]
        Skips the creation of the Recovery Partition
        
        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -Force [<SwitchParameter>]
        Required for execution as a safety precaution
        
        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see 
        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). 
    
INPUTS
    
OUTPUTS
    
NOTES
    
    
        19.10.10     Created by David Segura @SeguraOSD
    
    
RELATED LINKS
    https://osd.osdeploy.com/module/functions/new-osddisk
```

##


# Sandbox

19.10.11 David Segura

**`New-OSDDisk`** contains alot of parameters that you need to learn.  Keep in mind this function was designed to run in **WinPE | WinRE | WinSE** and it will not execute in Windows OS.  Rather than just throw an error and quit in full Windows Client, an Information Mode was designed.  Use Sandbox to test your parameters

Run **`New-OSDDisk`** without any parameters as a quick test, don't worry, it will not perform anything destructive in Windows OS, even when adding the **`Force`** parameter

```
New-OSDDisk
```

![](/files/-LtKz0hU4qIof1iBa71U)

## DiskNumber

```
#Fixed Disk Number
#Alias = Disk, Number
[Alias('Disk','Number')]
[int]$DiskNumber
```

The **`DiskNumber`** is automatically selected for you if you only have one Fixed Disk.  You will receive a prompt to select the disk if you have multiple Fixed Disks unless you set this parameter.  You can easily change this to whatever Disk you want as your **OSDDisk**

![](/files/-LtKzoDPKbfqy9MeJkCr)

## ClearDisk = All

```
#Clear-Disk Scope
#All will Clear all non-RAW Fixed Disks
#OSDDisk will Clear only the DiskNumber or SelectDisk
#Default = All
#Alias = Clear
[Alias('Clear')]
[ValidateSet('All','OSDDisk')]
[string]$ClearDisk = 'All'
```

**`New-OSDDisk`** will **`Clear-Disk`** every Fixed Disk by default to ensure that all the drives are clean.  You can change this to **`OSDDisk`** and it will only clear the Disk that will be the **OSDDisk**

```
New-OSDDisk -ClearDisk OSDDisk
```

![](/files/-LqsxcxcxboLT4CLJf5Q)

## SelectDisk

```
#Select OSDDisk if multiple Fixed Disks are present
#Supersedes the DiskNumber parameter
#Ignored if only one Fixed Disk is present
[switch]$SelectDisk
```

This is a good parameter to use if you have systems with multiple drives.  This will prompt you to select a Fixed Disk to use before continuing.  On systems with a single Fixed Disk, there will not be any prompts

I recommend using this parameter by default for Interactive installations

```
New-OSDDisk -SelectDisk
```

![](/files/-LqsyNpyFWqNN9o0Jq92)


# Partition Layout

19.10.11 David Segura

If you were looking for some control in the Partition Layout, the only thing that **`New-OSDDisk`** can do is to give you the option to not create the Recovery Partition.  Take the opportunity to see Microsoft's guidance below

## BIOS MBR Partition Layout

New-OSDDisk follows the Microsoft recommendation for Partition Layout&#x20;

```
SYSTEM | WINDOWS | RECOVERY
```

{% embed url="<https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/configure-biosmbr-based-hard-drive-partitions>" %}

![](/files/-LqggBxB8L265aXSswJE)

![](/files/-LqggqmQ5GafMp6i9wSp)

## UEFI GPT Partition Layout

UEFI GPT is similar to BIOS MBR, although you need to add the MSR partition, so:

```
SYSTEM | MSR | WINDOWS | RECOVERY
```

{% embed url="<https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/configure-uefigpt-based-hard-drive-partitions>" %}

![](/files/-LqghWnd5o-KHi10uAEO)

## SkipRecoveryPartition

```
#Skips the creation of the Recovery Partition
[switch]$SkipRecoveryPartition
```

The only thing you can do is skip the creation of the Recovery partition, which is easier to notice in a comparison

```
New-OSDDisk -SkipRecoveryPartition
```

![](/files/-Lqt3W7uH8Tjou6KJ0n1)


# Partition Sizes

19.10.11 David Segura

I don't recommend changing the Partition sizes from the defaults, as I consider them '**Perfect**'.  The only real difference between MBR and GPT is the MSR Partition for UEFI GPT layout

```
SYSTEM - 260MB | GPT MSR 16MB | WINDOWS - REMAINDER | RECOVERY - 990MB
```

**And when I say 'Perfect', this layout mirroring between MBR and GPR allows you to convert from MBR to GPR without moving around any partition data**

![](/files/-LqtAFA5Ey5wed4M5YUv)

## SizeSystemMbr

```
#System Partition size for BIOS MBR based Computers
#Default = 260MB
#Range = 100MB - 3000MB (3GB)
#Alias = SSM, Mbr, SystemM
[Alias('SSM','Mbr','SystemM')]
[ValidateRange(100MB,3000MB)]
[uint64]$SizeSystemMbr = 260MB
```

## SizeSystemGpt

```
#System Partition size for UEFI GPT based Computers
#Default = 260MB
#Range = 100MB - 3000MB (3GB)
#Alias = SSG, Efi, SystemG
[Alias('SSG','Efi','SystemG')]
[ValidateRange(100MB,3000MB)]
[uint64]$SizeSystemGpt = 260MB
```

## SizeMSR

```
#MSR Partition size
#Default = 16MB
#Range = 16MB - 128MB
#Alias = MSR
[Alias('MSR')]
[ValidateRange(16MB,128MB)]
[uint64]$SizeMSR = 16MB
```

## SizeRecovery

```
#Size of the Recovery Partition
#Default = 990MB
#Range = 350MB - 80000MB (80GB)
#Alias = SR, Recovery
[Alias('SR','Recovery')]
[ValidateRange(350MB,80000MB)]
[uint64]$SizeRecovery = 990MB
```


# Volume Labels

19.10.11 David Segura

You can easily change the default volume labels by using the **Label parameters** ... I'll save some electrons and combine this in one screenshot.  This should be easy enough to figure out

![](/files/-Lqt5oz_UrA3jJ0VUZWJ)

## LabelSystem

```
#Drive Label of the System Partition
#Default = System
#Alias = LS, LabelS
[Alias('LS','LabelS')]
[string]$LabelSystem = 'System'
```

## LabelWindows

```
#Drive Label of the Windows Partition
#Default = OS
#Alias = LW, LabelW
[Alias('LW','LabelW')]
[string]$LabelWindows = 'OS'
```

## Label Recovery

```
#Drive Label of the Recovery Partition
#Default = Recovery
#Alias = LR, LabelR
[Alias('LR','LabelR')]
[string]$LabelRecovery = 'Recovery'
```


# AutoUnattend.xml

19.10.11 David Segura

#### When using New-OSDDisk, I you should RunSynchronousCommand in the windowsPE settings pass with the following Path

```
PowerShell -Command "& {Start-Transcript | Out-Null;New-OSDDisk -Confirm -SelectDisk -Force;Stop-Transcript;Sleep -S 5}"
```

#### It should look something like this

```
<RunSynchronousCommand wcm:action="add">
    <Order>4</Order>
    <Description>New-OSDDisk</Description>
    <Path>PowerShell -Command "& {Start-Transcript | Out-Null;New-OSDDisk -Confirm -SelectDisk -Force;Stop-Transcript;Sleep -S 5}"</Path>
</RunSynchronousCommand>
```

![](/files/-LqtSz_uFvdViwQtQZ57)

#### The examples below will show what different Disk configurations look like with the AutoUnattend.xml

## BIOS MBR | 1 Disk | RAW

In this example, the only thing I had to press was P to Partition the Disk as it didn't need cleaning.  Keep in mind the Transcript display was my doing to show where the file was.  That can be left out or even hidden

![](/files/-Lqv4-CD05KRFg7HzUgT)

And here are the Partitions ready for Windows Setup

![](/files/-Lqv5EowLzDeVnFJZFqK)

## BIOS MBR | 1 Disk | Existing Data

Unlike the RAW disk in the previous example, this had to have the Disk cleaned so there was an additional Confirm prompt

![](/files/-Lqv4sJ7N4rsvpcu7KKs)


# Get-USBVolume


# Dism


# Get-MyWindowsCapability


# Get-MyWindowsPackage

21.2.8.1+


# Set-WimExecutionPolicy

You can't do much in PowerShell without setting the ExecutionPolicy

![](/files/-MSR_y6_ykNmoIt3_ndc)

## Example

This function will perform the following actions in one step

* [Mount-WindowsImageOSD](broken://pages/-LuGfgiq5vjs_Ela0mly)
* [Set-WindowsImageExecutionPolicy](/docs/trash/dism/set-windowsimageexecutionpolicy)
* [Dismount-WindowsImageOSD](broken://pages/-MSRSwYVMkV_nOMK2EmB) -Save

```
Set-WIMExecutionPolicy -ImagePath "D:\WinPE\sources\boot.wim" -ExecutionPolicy Bypass
```

![](/files/-MSRbKv0QnIFFPOsOhdI)

![](/files/-MSRcW_v-biZhkaXhDAG)


# Set-WindowsImageExecutionPolicy

By default, WinPE has the PowerShell Execution Policy to Restricted.  This can easily be changed

![](/files/-MSR_y6_ykNmoIt3_ndc)

## Example

One thing to keep in mind that if you don't specify the Set-WindowsImageExecutionPolicy Path, it will apply to all mounted Windows Images

```
Mount-WindowsImageOSD -ImagePath "T:\WinPE\sources\boot.wim"
Set-WindowsImageExecutionPolicy Bypass
Dismount-WindowsImageOSD -Save
```

![](/files/-MSRdVYls-Ne-MGuILXL)

![](/files/-MSRcW_v-biZhkaXhDAG)


# Display


# Get-VidConRes


# Driver


# Get-OSDDriverWmiQ

## Get-Help -Full

```
PS C:\> Get-Help -Full Get-OSDDriverWmiQ

NAME
    Get-OSDDriverWmiQ
    
SYNOPSIS
    Returns a Computer Model WMI Query that can be used in Task Sequences
    
    
SYNTAX
    Get-OSDDriverWmiQ [[-InputObject] <Object[]>] [-Make] <String> [-Result] <String> [-ShowTextFile] [<CommonParameters>]
    
    
DESCRIPTION
    Returns a Computer Model WMI Query that can be used in Task Sequences
    

PARAMETERS
    -InputObject <Object[]>
        
        Required?                    false
        Position?                    1
        Default value                
        Accept pipeline input?       true (ByValue)
        Accept wildcard characters?  false
        
    -Make <String>
        Select a Computer Manufacturer
        
        Required?                    true
        Position?                    2
        Default value                Dell
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -Result <String>
        Select whether the Query is based off Model or SystemId SystemSku Product
        
        Required?                    true
        Position?                    3
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -ShowTextFile [<SwitchParameter>]
        Open a Text File with the WMI Query after completion
        
        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see 
        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). 
    
INPUTS
    
OUTPUTS
    
NOTES
    
    
        19.12.6     David Segura @SeguraOSD
    
    
RELATED LINKS
    https://osd.osdeploy.com/module/functions/get-osddriverwmiq
```


# Get-OSDDriver

## Get-Help -Full

```
PS C:\> Get-Help -Full Get-OSDDriver

NAME
    Get-OSDDriver
    
SYNOPSIS
    Returns Driver information from Online and Local sources
    
    
SYNTAX
    Get-OSDDriver [-OSDGroup] <String> [-GridView] [<CommonParameters>]
    
    
DESCRIPTION
    Returns Driver information from Online and Local sources.  Used by OSDDrivers Module
    Value is returned as Global Variable $GetOSDDriver
    

PARAMETERS
    -OSDGroup <String>
        Limits the results to the specified OSDGroup
        
        Required?                    true
        Position?                    1
        Default value                
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false
        
    -GridView [<SwitchParameter>]
        Select results in GridView with PassThru
        
        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see 
        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). 
    
INPUTS
    
OUTPUTS
    
NOTES
    
    
        19.12.6     David Segura @SeguraOSD
    
    
RELATED LINKS
    https://osd.osdeploy.com/module/functions/get-osddriver
```


# General


# Get-OSD

## Get-Help -Full

```
PS C:\> Get-Help -Full OSD

NAME
    Get-OSD
    
SYNOPSIS
    Displays information about the OSD Module
    
    
SYNTAX
    Get-OSD [<CommonParameters>]
    
    
DESCRIPTION
    Displays information about the OSD Module
    

PARAMETERS
    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see 
        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). 
    
INPUTS
    
OUTPUTS
    
NOTES
    
    
        19.10.1     David Segura @SeguraOSD
    
    
RELATED LINKS
    https://osd.osdeploy.com/module/functions/get-osd
```

## Usage

#### Get-OSD simply returns information about the #OSDmodule.  Nothing more, nothing less

![](/files/-LvRnahGiqwT196fdfIu)


# Get-OSDClass

## Get-Help -Full

```
PS C:\> Get-Help -Full OSDClass

NAME
    Get-OSDClass
    
SYNOPSIS
    Returns CimInstance information from common OSD Classes
    
    
SYNTAX
    Get-OSDClass [[-Class] <String>] [<CommonParameters>]
    
    
DESCRIPTION
    Returns CimInstance information from common OSD Classes
    

PARAMETERS
    -Class <String>
        CimInstance Class Name
        Battery
        BaseBoard
        BIOS
        BootConfiguration
        ComputerSystem [DEFAULT]
        Desktop
        DiskPartition
        DisplayConfiguration
        Environment
        LogicalDisk
        LogicalDiskRootDirectory
        MemoryArray
        MemoryDevice
        NetworkAdapter
        NetworkAdapterConfiguration
        OperatingSystem
        OSRecoveryConfiguration
        PhysicalMedia
        PhysicalMemory
        PnpDevice
        PnPEntity
        PortableBattery
        Processor
        SCSIController
        SCSIControllerDevice
        SMBIOSMemory
        SystemBIOS
        SystemEnclosure
        SystemDesktop
        SystemPartitions
        UserDesktop
        VideoController
        VideoSettings
        Volume
        
        Required?                    false
        Position?                    1
        Default value                ComputerSystem
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see 
        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). 
    
INPUTS
    
OUTPUTS
    
NOTES
    
    
        19.10.1     David Segura @SeguraOSD
    
    -------------------------- EXAMPLE 1 --------------------------
    
    PS C:\>OSDClass
    
    Returns CimInstance Win32_ComputerSystem properties
    Option 1: Get-OSDClass
    Option 2: Get-OSDClass ComputerSystem
    Option 3: Get-OSDClass -Class ComputerSystem
    
    
    
    
    
RELATED LINKS
    https://osd.osdeploy.com/module/functions/get-osdclass
```


# Get-OSDGather

## Get-Help -Full

```
PS C:\> Help OSDGather -Full

NAME
    Get-OSDGather
    
SYNOPSIS
    Returns common OSD information as an ordered hash table
    
    
SYNTAX
    Get-OSDGather [-Full] [<CommonParameters>]
    
    
DESCRIPTION
    Returns common OSD information as an ordered hash table
    

PARAMETERS
    -Full [<SwitchParameter>]
        Optionally include CimInstance
        
        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see 
        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). 
    
INPUTS
    
OUTPUTS
    
NOTES
    
    
        19.10.1     David Segura @SeguraOSD
    
    -------------------------- EXAMPLE 1 --------------------------
    
    PS C:\>$OSDGather = Get-OSDGather
    
    $OSDGather.Model
    
    
    
    
    
RELATED LINKS
    https://osd.osdeploy.com/module/functions/get-osdgather
```


# Get-OSDPower

## Get-Help -Full

```
PS C:\> Help OSDPower -Full

NAME
    Get-OSDPower
    
SYNOPSIS
    Displays Power Plan information using powercfg /LIST
    
    
SYNTAX
    Get-OSDPower [[-Property] <String>] [<CommonParameters>]
    
    
DESCRIPTION
    Displays Power Plan information using powercfg /LIST.  Optionally Set an Active Power Plan
    

PARAMETERS
    -Property <String>
        Powercfg option (Low, Balanced, High, LIST, QUERY)
        Default is LIST
        
        Required?                    false
        Position?                    1
        Default value                LIST
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see 
        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). 
    
INPUTS
    
OUTPUTS
    
NOTES
    
    
        19.10.1     David Segura @SeguraOSD
    
    -------------------------- EXAMPLE 1 --------------------------
    
    PS C:\>OSDPower
    
    Returns Power Plan information using powercfg /LIST
    Option 1: Get-OSDPower
    Option 2: Get-OSDPower LIST
    Option 3: Get-OSDPower -Property LIST
    
    
    
    
    -------------------------- EXAMPLE 2 --------------------------
    
    PS C:\>OSDPower High
    
    Sets the active Power Plan to High Performance
    Option 1: Get-OSDPower High
    Option 2: Get-OSDPower -Property High
    
    
    
    
    
RELATED LINKS
    https://osd.osdeploy.com/module/functions/get-osdpower
```


# Get-RegCurrentVersion

## Get-Help -Full

```
PS C:\> Get-Help -Full Get-RegCurrentVersion

NAME
    Get-RegCurrentVersion
    
SYNOPSIS
    Returns the Registry Key values from HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion
    
    
SYNTAX
    Get-RegCurrentVersion [[-Path] <String>] [[-Property] <String>] [<CommonParameters>]
    
    
DESCRIPTION
    Returns the Registry Key values from HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion for Online and Offline Windows Images
    

PARAMETERS
    -Path <String>
        Specifies the full path to the root directory of the offline Windows image that you will service.
        
        Required?                    false
        Position?                    1
        Default value                
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false
        
    -Property <String>
        
        Required?                    false
        Position?                    2
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see 
        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). 
    
INPUTS
    
OUTPUTS
    
NOTES
    
    
        19.11.20    Added Pipeline Support
        19.11.9     David Segura @SeguraOSD Initial Release
    
    
RELATED LINKS
    https://osd.osdeploy.com/module/functions/get-regcurrentversion
```

## Usage

#### Without any parameters, this function will simply return the CurrentVersion Registry Key

![](/files/-LuH-NUwUA256GqNtJCk)

#### For a Mounted Windows Image, simply provide a Path to the Mount Directory and it will mount the Registry and do the work for you

![](/files/-LuGmx08TUMqzMfIK7qk)

#### So now you can make quick work getting the ReleaseId using the following examples

![](/files/-LuH-fELSdrZFBWe2CGZ)

##


# Get-SessionsXml

## **Get-Help -Full**

```
PS C:\> Get-Help -Full Get-OSDSessions

NAME
    Get-OSDSessions
    
SYNOPSIS
    Returns the Session.xml Updates that have been applied to an Operating System
    
    
SYNTAX
    Get-OSDSessions [[-Path] <String>] [<CommonParameters>]
    
    
DESCRIPTION
    Returns the Session.xml Updates that have been applied to an Operating System
    

PARAMETERS
    -Path <String>
        Specifies the full path to the root directory of the offline Windows image that you will service
        Or Path of the Sessions.xml file
        If this value is not set, the running OS Sessions.xml will be processed
        
        Required?                    false
        Position?                    1
        Default value                "$env:SystemRoot\Servicing\Sessions\Sessions.xml"
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false
        
    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see 
        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). 
    
INPUTS
    
OUTPUTS
    
NOTES
    
    
        19.11.20    Path now supports Mounted WIM Path
        19.10.14    David Segura @SeguraOSD Initial Release
    
    
RELATED LINKS
    https://osd.osdeploy.com/module/functions/get-osdsessions
```

## Running OS

![](/files/-LuBGFf0zUcItwDURmsl)

## Mounted Image

![](/files/-Lu8XA5bCnpI7LGE_coZ)


# Save-OSDDownload

## Get-Help -Full

```
PS C:\> Get-Help -Full Save-OSDDownload

NAME
    Save-OSDDownload
    
SYNOPSIS
    Downloads a file from the internet
    
    
SYNTAX
    Save-OSDDownload [-SourceUrl] <String> [-DownloadFolder <String>] [-Overwrite] [-BitsTransfer] [<CommonParameters>]
    
    
DESCRIPTION
    Downloads a file from the internet.  Success returns $true
    

PARAMETERS
    -SourceUrl <String>
        URL of the file to download
        
        Required?                    true
        Position?                    1
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -DownloadFolder <String>
        Destination Folder
        
        Required?                    false
        Position?                    named
        Default value                "$env:TEMP\OSD"
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -Overwrite [<SwitchParameter>]
        Overwrite the file if it exists already
        The default action is to skip the download
        
        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -BitsTransfer [<SwitchParameter>]
        Download the file using BITS-Transfer
        Interactive Login required
        
        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see 
        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). 
    
INPUTS
    
OUTPUTS
    
NOTES
    
    
        19.10.25 David Segura @SeguraOSD
    
    
RELATED LINKS
    https://osd.osdeploy.com/module/functions/save-osddownload
```


# MyBitLocker

OSD 21.2.10.1+

MyBitLocker Functions require the BitLocker PowerShell Module and RunAsAdministrator.  WinPE is supported by adding the OSD and the BitLocker PowerShell Modules

```
PS C:\> Get-Command *MyBitLocker*

CommandType     Name                                               Version    Source                                                               
-----------     ----                                               -------    ------                                                               
Function        Backup-MyBitLockerKeys                             21.2.10.1  OSD                                                                  
Function        Get-MyBitLockerKeyProtectors                       21.2.10.1  OSD                                                                  
Function        Save-MyBitLockerExternalKey                        21.2.10.1  OSD                                                                  
Function        Save-MyBitLockerKeyPackage                         21.2.10.1  OSD                                                                  
Function        Save-MyBitLockerRecoveryPassword                   21.2.10.1  OSD                                                                  
Function        Unlock-MyBitLockerExternalKey                      21.2.10.1  OSD  
```

## Get-Help -Full

All the details on how to use the functions are in Get-Help -Full

```
Get-Help -Full Backup-MyBitLockerKeys
Get-Help -Full Get-MyBitLockerKeyProtectors
Get-Help -Full Save-MyBitLockerExternalKey
Get-Help -Full Save-MyBitLockerKeyPackage
Get-Help -Full Save-MyBitLockerRecoveryPassword
Get-Help -Full Unlock-MyBitLockerExternalKey
```

```
PS C:\> Get-Help -Full Backup-MyBitLockerKeys

NAME
    Backup-MyBitLockerKeys
    
SYNOPSIS
    Saves all BitLocker ExternalKeys (BEK), KeyPackages (KPG), and RecoveryPasswords (TXT)
    
    
SYNTAX
    Backup-MyBitLockerKeys [-Path] <String[]> [<CommonParameters>]
    
    
DESCRIPTION
    Saves all BitLocker ExternalKeys (BEK), KeyPackages (KPG), and RecoveryPasswords (TXT) to a Directory (Path)
    

PARAMETERS
    -Path <String[]>
        Directory to save the BitLocker Keys.  This directory will be created if it does not exist
        
        Required?                    true
        Position?                    1
        Default value                
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false
        
    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see 
        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). 
    
INPUTS
    
OUTPUTS
    
NOTES
    
    
        Requires Administrative Rights
        Requires BitLocker Module | Get-BitLockerVolume
        21.2.10  Initial Release
    
    
RELATED LINKS
    https://osd.osdeploy.com/module/mybitlocker/backup-mybitlockerkeys
```

## Get-Help -Online

The -Online parameter will open these function links in your browser

```
Get-Help -Online Backup-MyBitLockerKeys
Get-Help -Online Get-MyBitLockerKeyProtectors
Get-Help -Online Save-MyBitLockerExternalKey
Get-Help -Online Save-MyBitLockerKeyPackage
Get-Help -Online Save-MyBitLockerRecoveryPassword
Get-Help -Online Unlock-MyBitLockerExternalKey
```

![](/files/-MTCO-_U0l-3G2QItEo6)

## WinPE Installation

```
Copy-PSModuleToWim -ImagePath <Path to WIM> -ExecutionPolicy Bypass -Name OSD, BitLocker
```


# Get-MyBitLockerKeyProtectors

Returns an Object containing Locked and Unlocked BitLocker Volumes

![](/files/-MTCGPawIOPzCheMGNAD)

## -ShowRecoveryPassword

Displays the RecoveryPassword for Unlocked BitLocker Volumes

![](/files/-MTCGZMAEyWCaaB4IZvu)

## Warnings

These are displayed if you don't have a RecoveryPassword or ExternalKey, or if you have too many

![](/files/-MTCHVdGLrGd3n2TXEmv)

Use this information to filter down the offending BitLocker KeyProtector

![](/files/-MTCHdItea-cR60y1U5o)

And then remediate if necessary

{% hint style="danger" %}
Make sure you backup your BitLocker KeyProtectors first
{% endhint %}

![](/files/-MTCHjKq-XhuHjegzopb)


# Backup-MyBitLocker

This function will backup all BitLocker ExternalKeys (BEK), KeyPackages (KPG), and RecoveryPasswords (TXT) to a Directory (Path)

```
Backup-MyBitLockerKeys -Path F:\BitLocker\$(Get-MyBiosSerialNumber -Brief)
```

![](/files/-MTCJFfcWzW36sfb777N)

In the command above, I backed up everything to a Directory matching my BIOS Serial Number on my USB Drive

![](/files/-MTCIs_e8orn8aiufbP7)

## Multiple Paths

Supported.

```
Backup-MyBitLockerKeys -Path F:\BitLocker1, F:\BitLocker2
```

![](/files/-MTCJtC0KTmJrpAv2iI8)


# Save-MyBitLockerExternalKey

Saves all BitLocker ExternalKeys (BEK) to a Directory (Path).  BitLocker ExternalKeys should always be saved to the ROOT of a USB Drive for WinPE AutoUnlock.  Multiple Paths can be specified

```
Save-MyBitLockerExternalKey -Path F:\
Save-MyBitLockerExternalKey -Path F:\,F:\BitLocker\$(Get-MyBiosSerialNumber -Brief)
```

![](/files/-MTCKgpUQU2XVs7w_BOY)


# Save-MyBitLockerKeyPackage

Saves all BitLocker KeyPackages (KPG) to a Directory (Path). The key package can be used in conjunction with the repair tool to repair corrupted drives.  Multiple Paths are supported

```
Save-MyBitLockerKeyPackage -Path F:\
Save-MyBitLockerKeyPackage -Path F:\,F:\BitLocker\$(Get-MyBiosSerialNumber -Brief)
```

![](/files/-MTCLYEKjKHYcZAH8Q6V)

## KeyPackage Reference

{% embed url="<https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/manage-bde-keypackage>" %}


# Save-MyBitLockerRecoveryPassword

This is the 48 character BitLocker Password Key saved in the style of Microsoft.  Multiple Paths are supported

```
Save-MyBitLockerRecoveryPassword -Path F:\BitLocker\$(Get-MyBiosSerialNumber -Brief)
```

![](/files/-MTCM-YCskaNBVjx0pMt)


# Unlock-MyBitLockerExternalKey

This function will automatically Unlock any BitLocker Locked Volumes by providing a Path containing a matching ExternalKey (BEK)

![](/files/-MTCN8zO3--1jVYeH-hF)

![](/files/-MTCNFpRdcfdc8dWnQ9T)

![](/files/-MTCNWFoor438knaPcrg)

![](/files/-MTCNdHue6AM-QgWBkfb)

## -Recurse

This parameter can optionally be used to search recursively for a matching ExternalKey (BEK)


# PSModule

{% content-ref url="/pages/-MSH9AB\_d2GEDhj7uhw-" %}
[Copy-PSModuleToFolder](/docs/trash/psmodule/copy-psmoduletofolder)
{% endcontent-ref %}

{% content-ref url="/pages/-MT7BeC\_XTbhQQWWQTgo" %}
[Copy-PSModuleToWim](/docs/trash/psmodule/copy-psmoduletowim)
{% endcontent-ref %}

{% content-ref url="/pages/-MT7Bgm6m9rtWqabKj7O" %}
[Copy-PSModuleToWindowsImage](/docs/trash/psmodule/copy-psmoduletowindowsimage)
{% endcontent-ref %}


# Copy-PSModuleToFolder

OSD 21.2.9.2+

**Copy-PSModuleToFolder** used to copy an **installed** PowerShell Module to separate destination directory.  The destination directory will be created if it does not exist

```
PS C:\> Get-Help Copy-PSModuleToFolder -Full

NAME
    Copy-PSModuleToFolder
    
SYNOPSIS
    Get-Module and copy the ModuleBase to a new Destination\ModuleBase
    
    
SYNTAX
    Copy-PSModuleToFolder [-Name] <String[]> [-Destination] <String> [-RemoveOldVersions] [<CommonParameters>]
    
    
DESCRIPTION
    Get-Module and copy the ModuleBase to a new Destination\ModuleBase
    

PARAMETERS
    -Name <String[]>
        Name of the PowerShell Module to Copy
        
        Required?                    true
        Position?                    1
        Default value                
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  true
        
    -Destination <String>
        Destination PSModule directory
        Copied Module is a Child of Destination
        
        Required?                    true
        Position?                    2
        Default value                
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false
        
    -RemoveOldVersions [<SwitchParameter>]
        Removes older Module Versions from the Destination
        
        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see 
        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). 
    
INPUTS
    
OUTPUTS
    
NOTES
    
    
        21.1.30.1   Initial Release
        21.1.30.2   Added WinPE Parameter
        21.1.30.3   Renamed PSModulePath Parameter to Destination, Added RemoveOldVersions
        21.1.31.1   Removed WinPE Parameter
        21.2.2.1	Renamed to Copy-ModuleToFolder so I don't mess with PowerShellGet
        21.2.9.1	Renamed to Copy-PSModuleToFolder to standardize
    
    
RELATED LINKS
    https://osd.osdeploy.com/module/functions/psmodule/copy-psmoduletofolder
```

## -Name

```
#String
-Name PShot

#Array of Strings
-Name PShot,OSD,OSDBuilder

#Wildcard
-Name OSD*

#Position 0
Copy-Module PShot
```

![](/files/-MSJHq_-KJ2qTo4IIvfg)

![](/files/-MSJIBXzuO7T-Hl-kSTu)

## -Destination

```
#Module will be copied to T:\Temp\PShot\<ModuleVersion>
Copy-Module -Name PShot -Destination T:\Temp

#Module will be copied to C:\Program Files\WindowsPowerShell\Modules\OSD\<ModuleVersion>
Copy-Module -Name OSD -Destination "C:\Program Files\WindowsPowerShell\Modules"
```

## -RemoveOldVersions

```
-RemoveOldVersions [<SwitchParameter>]
    Removes older Module Versions from the Destination
    
    Required?                    false
    Position?                    named
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false
```

![-RemoveOldVersions:$true](/files/-MSH_1po4HWcYzoJDbRk)

## Versioning

If multiple versions of a Module exist, only the latest will be copied

![](/files/-MSHFHiKVARHfJo2YjDZ)

## Version Subfolders

Version Subfolders are retained by Copy-Module, unless the **`-WinPE`** or **`-RemoveOldVersions`**&#x70;arameters are used

![-RemoveOldVersions:$false](/files/-MSHK5XWrtcnJFWtrFXi)


# Copy-PSModuleToWim

OSD 21.2.9.2+

```
PS C:\> Get-Help Copy-PSModuleToWim -Full

NAME
    Copy-PSModuleToWim
    
SYNOPSIS
    Copies the latest installed named PowerShell Module to a Windows Image .wim file (Mount | Copy | Dismount -Save)
    
    
SYNTAX
    Copy-PSModuleToWim [[-ExecutionPolicy] <String>] [-ImagePath] <String[]> [[-Index] <UInt32>] [-Name] <String[]> [<CommonParameters>]
    
    
DESCRIPTION
    Copies the latest installed named PowerShell Module to a Windows Image .wim file (Mount | Copy | Dismount -Save)
    

PARAMETERS
    -ExecutionPolicy <String>
        Specifies the new execution policy. The acceptable values for this parameter are:
        - Restricted. Does not load configuration files or run scripts. Restricted is the default execution policy.
        - AllSigned. Requires that all scripts and configuration files be signed by a trusted publisher, including scripts that you write on the local computer.
        - RemoteSigned. Requires that all scripts and configuration files downloaded from the Internet be signed by a trusted publisher.
        - Unrestricted. Loads all configuration files and runs all scripts. If you run an unsigned script that was downloaded from the Internet, you are prompted for permission before it runs.
        - Bypass. Nothing is blocked and there are no warnings or prompts.
        - Undefined. Removes the currently assigned execution policy from the current scope. This parameter will not remove an execution policy that is set in a Group Policy scope.
        
        Required?                    false
        Position?                    1
        Default value                
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false
        
    -ImagePath <String[]>
        Specifies the location of the WIM or VHD file containing the Windows image you want to mount.
        
        Required?                    true
        Position?                    2
        Default value                
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false
        
    -Index <UInt32>
        Index of the WIM to Mount
        Default is 1
        
        Required?                    false
        Position?                    3
        Default value                1
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false
        
    -Name <String[]>
        Name of the PowerShell Module to Copy
        
        Required?                    true
        Position?                    4
        Default value                
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  true
        
    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see 
        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). 
    
INPUTS
    
OUTPUTS
    
NOTES
    
    
        21.2.9  Initial Release
    
    
RELATED LINKS
    https://osd.osdeploy.com/module/functions/psmodule/copy-psmoduletowim
```


# Copy-PSModuleToWindowsImage

OSD 21.2.9.2+

```
PS C:\> Get-Help Copy-PSModuleToWim -Full

NAME
    Copy-PSModuleToWim
    
SYNOPSIS
    Copies the latest installed named PowerShell Module to a Windows Image .wim file (Mount | Copy | Dismount -Save)
    
    
SYNTAX
    Copy-PSModuleToWim [[-ExecutionPolicy] <String>] [-ImagePath] <String[]> [[-Index] <UInt32>] [-Name] <String[]> [<CommonParameters>]
    
    
DESCRIPTION
    Copies the latest installed named PowerShell Module to a Windows Image .wim file (Mount | Copy | Dismount -Save)
    

PARAMETERS
    -ExecutionPolicy <String>
        Specifies the new execution policy. The acceptable values for this parameter are:
        - Restricted. Does not load configuration files or run scripts. Restricted is the default execution policy.
        - AllSigned. Requires that all scripts and configuration files be signed by a trusted publisher, including scripts that you write on the local computer.
        - RemoteSigned. Requires that all scripts and configuration files downloaded from the Internet be signed by a trusted publisher.
        - Unrestricted. Loads all configuration files and runs all scripts. If you run an unsigned script that was downloaded from the Internet, you are prompted for permission before it runs.
        - Bypass. Nothing is blocked and there are no warnings or prompts.
        - Undefined. Removes the currently assigned execution policy from the current scope. This parameter will not remove an execution policy that is set in a Group Policy scope.
        
        Required?                    false
        Position?                    1
        Default value                
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false
        
    -ImagePath <String[]>
        Specifies the location of the WIM or VHD file containing the Windows image you want to mount.
        
        Required?                    true
        Position?                    2
        Default value                
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false
        
    -Index <UInt32>
        Index of the WIM to Mount
        Default is 1
        
        Required?                    false
        Position?                    3
        Default value                1
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false
        
    -Name <String[]>
        Name of the PowerShell Module to Copy
        
        Required?                    true
        Position?                    4
        Default value                
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  true
        
    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see 
        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). 
    
INPUTS
    
OUTPUTS
    
NOTES
    
    
        21.2.9  Initial Release
    
    
RELATED LINKS
    https://osd.osdeploy.com/module/functions/psmodule/copy-psmoduletowim




PS C:\> Get-Help Copy-PSModuleToWindowsImage -Full

NAME
    Copy-PSModuleToWindowsImage
    
SYNOPSIS
    Copies the latest installed named PowerShell Module to a mounted Windows Image
    
    
SYNTAX
    Copy-PSModuleToWindowsImage [[-ExecutionPolicy] <String>] [[-Path] <String[]>] [<CommonParameters>]
    
    
DESCRIPTION
    Copies the latest installed named PowerShell Module to a mounted Windows Image
    

PARAMETERS
    -ExecutionPolicy <String>
        Specifies the new execution policy. The acceptable values for this parameter are:
        - Restricted. Does not load configuration files or run scripts. Restricted is the default execution policy.
        - AllSigned. Requires that all scripts and configuration files be signed by a trusted publisher, including scripts that you write on the local computer.
        - RemoteSigned. Requires that all scripts and configuration files downloaded from the Internet be signed by a trusted publisher.
        - Unrestricted. Loads all configuration files and runs all scripts. If you run an unsigned script that was downloaded from the Internet, you are prompted for permission before it runs.
        - Bypass. Nothing is blocked and there are no warnings or prompts.
        - Undefined. Removes the currently assigned execution policy from the current scope. This parameter will not remove an execution policy that is set in a Group Policy scope.
        
        Required?                    false
        Position?                    1
        Default value                
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false
        
    -Path <String[]>
        Specifies the full path to the root directory of the offline Windows image that you will service
        If a Path is not specified, all mounted Windows Images will be modified
        
        Required?                    false
        Position?                    2
        Default value                
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false
        
    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see 
        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). 
    
INPUTS
    
OUTPUTS
    
NOTES
    
    
        21.2.9  Initial Release
    
    
RELATED LINKS
    https://osd.osdeploy.com/module/functions/psmodule/copy-psmoduletowindowsimage
```


# WebConnection

## Test-WebConnection


# WebPSScript

## Invoke-WebPSScript

This is quite a simple function that allows me to Invoke a PowerShell script in a URL.  As you can see this is working in WinPE, but fails when I try to Install-Module.  That's because PowerShell Gallery doesn't work in WinPE by default.  I guess I need to read this first

{% content-ref url="/pages/-MVIO2jJ16qb50jOcwLO" %}
[Enable-PEWimPSGallery](/docs/trash/winpe/enable-pewimpsgallery)
{% endcontent-ref %}

![](/files/-MVINlKKXsILUFq-xeBd)


# WinPEWim

## Edit-WinPEWim


# WinPE


# Enable-PEWimPSGallery

{% embed url="<https://www.osdeploy.com/blog/2021/winpe-powershell-gallery>" %}

## The Function

What this function does is

1. Mounts a WinPE WIM
2. Adds the missing Volatile Environment (in Current Environment)
3. Saves PackageManagenment and PowerShellGet Modules from PowerShell Gallery in the WIM
4. Dismount and Save the WinPE WIM

![](/files/-MVIUO1NqkGYLzOjrEVa)

## Results

After modifying the WIM, I can test the changes by creating an ISO (or you can USB, whatever).  Works like a champ!

![](/files/-MVIVpUDgScKG1LTeNve)

![](/files/-MVIX-A-oyYqoyz9fnP9)


# Get-OSDWinPE

## Get-Help -Full

```
PS C:\> Get-Help Get-OSDWinPE -Full

NAME
    Get-OSDWinPE
    
SYNOPSIS
    Common WinPE Commands using wpeutil and Microsoft DaRT RemoteRecovery
    
    
SYNTAX
    Get-OSDWinPE [-AddModules] [[-ImportModule] <String[]>] [[-CallScript] <String>] [-InitializeNetwork] [-InitializeNetworkNoWait] 
    [-WaitForNetwork] [-WaitForRemovableStorage] [-DisableFirewall] [-UpdateBootInfo] [-RemoteRecovery] [-Reboot] [-Shutdown] 
    [<CommonParameters>]
    
    
DESCRIPTION
    Common WinPE Commands using wpeutil and Microsoft DaRT RemoteRecovery
    

PARAMETERS
    -AddModules [<SwitchParameter>]
        PowerShell Module Parameter
        Searches all Drives for <drive>:\Modules directory
        Copies Modules content to System32 $PSModulesPath
        
        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -ImportModule <String[]>
        PowerShell Module Parameter
        Imports a PowerShell Module by Name
        PowerShell Module must exist in $PSModulePath
        
        Required?                    false
        Position?                    1
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -CallScript <String>
        PowerShell Script Parameter
        Searches all Drives for <drive>:\$ImportModule file
        Calls <drive>:\$ImportModule in the current PS Session
        
        Required?                    false
        Position?                    2
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -InitializeNetwork [<SwitchParameter>]
        wpeutil InitializeNetwork
        Initializes network components and drivers and sets the computer name to a randomly-chosen value
        
        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -InitializeNetworkNoWait [<SwitchParameter>]
        wpeutil InitializeNetwork /NoWait
        Initializes network components and drivers and sets the computer name to a randomly-chosen value
        The /NoWait option will skip the time where your PC would otherwise wait to acquire an IP address
        If you don't use /NoWait, Windows PE will wait to acquire an address before it finishes loading your WinPE session
        /NoWait is helpful for environments that don't use DHCP
        
        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -WaitForNetwork [<SwitchParameter>]
        wpeutil WaitForNetwork
        Waits for the network card to be initialized
        Use this command when creating scripts to make sure that the network card has been fully initialized before continuing
        
        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -WaitForRemovableStorage [<SwitchParameter>]
        wpeutil WaitForRemovableStorage
        During the Windows PE startup sequence, this command will block startup until the removable storage devices, such as USB hard 
        drives, are initialized
        
        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -DisableFirewall [<SwitchParameter>]
        wpeutil DisableFirewall
        Disables the Firewall
        
        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -UpdateBootInfo [<SwitchParameter>]
        wpeutil UpdateBootInfo
        Populates the registry with information about how Windows PE boots
        After you run this command, query the registry. For example:
        reg query HKLM\System\CurrentControlSet\Control /v PEBootType
        The results of this operation might change after loading additional driver support.
        To determine where Windows PE is booted from, examine the following:
           PEBootType: Error, Flat, Remote, Ramdisk:SourceIdentified Ramdisk:SourceUnidentified, Ramdisk:OpticalDrive
           PEBootTypeErrorCode: HRESULT code
           PEBootServerName: Windows Deployment Services server name
           PEBootServerAddr: Windows Deployment Services server IP address
           PEBootRamdiskSourceDrive: Source drive letter, if available.
           PEFirmwareType: Firmware boot mode: 0x1 for BIOS, 0x2 for UEFI.
        If you are not booting Windows Deployment Services, the best way to determine where Windows PE booted from is to first check 
        for PEBootRamdiskSourceDrive registry key
        If it is not present, scan the drives of the correct PEBootType and look for some kind of tag file that identifies the boot 
        drive
        
        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -RemoteRecovery [<SwitchParameter>]
        RemoteRecovery.exe -nomessage
        Microsoft Diagnostic and Recovery Toolset Remote Recovery
        
        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -Reboot [<SwitchParameter>]
        wpeutil Reboot
        Reboots the computer
        
        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -Shutdown [<SwitchParameter>]
        wpeutil Shutdown
        Shutdown the computer
        
        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see 
        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). 
    
INPUTS
    
OUTPUTS
    
NOTES
    
    
        19.10.1     David Segura @SeguraOSD
    
    
RELATED LINKS
    https://osd.osdeploy.com/module/functions/get-osdwinpe
```


