> 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

![](https://3420392058-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LpnxLqvh8u2fEz86kIM%2F-MVIO0PvSWQ65xUI578M%2F-MVIUO1NqkGYLzOjrEVa%2Fimage.png?alt=media\&token=739a08b2-5a40-412b-985a-62e9eb3f37aa)

## Results

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

![](https://3420392058-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LpnxLqvh8u2fEz86kIM%2F-MVIO0PvSWQ65xUI578M%2F-MVIVpUDgScKG1LTeNve%2Fimage.png?alt=media\&token=aef47baa-0c5c-415e-a162-901f363663c2)

![](https://3420392058-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LpnxLqvh8u2fEz86kIM%2F-MVIO0PvSWQ65xUI578M%2F-MVIX-A-oyYqoyz9fnP9%2Fimage.png?alt=media\&token=3a1ecec2-5b50-4e67-b421-3e5076308986)
