# OSPoshMods PEPoshMods

For starters, PoshMods = PowerShell Modules ... so yes, you can easily add PowerShell Modules to WinPE and your OS using these ContentPacks.  Since you should have added PowerShell using PEADK, why not update some Modules while you are at it

## ContentPack Structure

Directories within OSPoshMods are created by default and follows this logical assignment

```
OSPoshMods\ProgramFiles
    Content injects to OS at <Mount>\Program Files\WindowsPowerShell\Modules
OSPoshMods\System
    Content injects to OS at <Mount>\Windows\System32\WindowsPowerShell\v1.0\Modules
```

Directories within PEPoshMods are created by default and follows this logical assignment

```
PEPoshMods\ProgramFiles
    Content injects to WinPE at <Mount>\Program Files\WindowsPowerShell\Modules
PEPoshMods\System
    Content injects to WinPE at <Mount>\Windows\System32\WindowsPowerShell\v1.0\Modules
```

## Installed Modules

Let's first see what we have installed in Windows.  You should have two PowerShell Modules directories that are used by default ... so let's see what is in them

```
C:\Program Files\WindowsPowerShell\Modules
C:\Windows\System32\WindowsPowerShell\v1.0\Modules
```

## OS Program Files

These are some pretty old versions installed out of the box on Windows 10 1909

![](https://1642863114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LmIIKLDn2u7Sp5DGyF2%2F-Lsz6J3YyEYRMOEAL5dj%2F-Lsz7k9O__VjmnjD4KVF%2Fimage.png?alt=media\&token=70e0409d-9522-4c35-bab8-97d7e56f554c)

## OS System32

Ok this looks a bit more complicated

![](https://1642863114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LmIIKLDn2u7Sp5DGyF2%2F-Lsz6J3YyEYRMOEAL5dj%2F-Lsz8CMe4PaoFncD-Y_q%2Fimage.png?alt=media\&token=9cc08b49-5eb4-4cea-92f7-349417a70208)

## WinSE Program Files

Just some old versions of PowerShellGet and PSReadline

![](https://1642863114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LmIIKLDn2u7Sp5DGyF2%2F-LszITe0vN0PCuptBnZU%2F-LszJd01bfcfDUYhU-we%2Fimage.png?alt=media\&token=e49c7478-624d-447c-ab5a-2dd4442222eb)

## WinSE System32

Nothing too out of the ordinary

![](https://1642863114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LmIIKLDn2u7Sp5DGyF2%2F-LszITe0vN0PCuptBnZU%2F-LszK348DSF6w9MranLw%2Fimage.png?alt=media\&token=3df4b47d-8537-4c9f-a920-b2a2b9d949c8)

## Save-Module

Use the Save-Module cmdlet to easily add PowerShell Modules from PowerShell Gallery to the ContentPacks.  Add the Verbose parameter for detailed results

```
Save-Module -Name OSD -Path D:\OSDBuilder\SeguraOSD\ContentPacks\_Global\OSPoshMods\ProgramFiles
Save-Module -Name OSD -Path D:\OSDBuilder\SeguraOSD\ContentPacks\_Global\PEPoshMods\ProgramFiles
Save-Module -Name PackageManagement -Path D:\OSDBuilder\SeguraOSD\ContentPacks\_Global\OSPoshMods\ProgramFiles
Save-Module -Name PackageManagement -Path D:\OSDBuilder\SeguraOSD\ContentPacks\_Global\PEPoshMods\ProgramFiles
Save-Module -Name Pester -Path D:\OSDBuilder\SeguraOSD\ContentPacks\_Global\OSPoshMods\ProgramFiles
Save-Module -Name PowerShellGet -Path D:\OSDBuilder\SeguraOSD\ContentPacks\_Global\OSPoshMods\ProgramFiles
Save-Module -Name PowerShellGet -Path D:\OSDBuilder\SeguraOSD\ContentPacks\_Global\PEPoshMods\ProgramFiles
```

![](https://1642863114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LmIIKLDn2u7Sp5DGyF2%2F-Lt0YLv4HtlhhhIx7GDM%2F-Lt0ZeDMPIXlewQD8Llo%2Fimage.png?alt=media\&token=162df4f4-0936-4307-b086-367fe253ea30)

## Build

Simple enough, it's just a file copy ...&#x20;

```
New-OSBuild -SkipTask -Execute -SkipComponentCleanup -SkipUpdates -CreateISO
```

![](https://1642863114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LmIIKLDn2u7Sp5DGyF2%2F-Lt0joQCutg9nIBWiLCA%2F-Lt0jwzqQJ-1TmMC7IIp%2Fimage.png?alt=media\&token=239d1f7b-3817-476d-9005-dadb2924b1d2)
