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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://osd.osdeploy.com/docs/trash/winpe/enable-pewimpsgallery.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
