> For the complete documentation index, see [llms.txt](https://osd.osdeploy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://osd.osdeploy.com/docs/trash/winpe/enable-pewimpsgallery.md).

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