> For the complete documentation index, see [llms.txt](https://breakpoint-journal.gitbook.io/breakpoint/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://breakpoint-journal.gitbook.io/breakpoint/windows/htb-windows-privilege-escalation-skills-assessment-part-ii/powershell-module-basics.md).

# PowerShell Module Basics

Quick commands for importing modules, listing module commands, and getting help during Windows assessments.

## PowerShell module basics

Use modules when a tool ships as a `.ps1`, `.psm1`, or `.psd1` file.

This is common during Windows privilege escalation work.

### Import a module

{% tabs %}
{% tab title="Manifest (.psd1)" %}

```powershell
Import-Module C:\path\to\module.psd1
```

{% endtab %}

{% tab title="Module file (.psm1)" %}

```powershell
Import-Module C:\path\to\module.psm1
```

{% endtab %}

{% tab title="Script (.ps1)" %}

```powershell
. C:\path\to\tool.ps1
```

{% endtab %}
{% endtabs %}

### Confirm the import

```powershell
Get-Module
Get-Module -ListAvailable
```

Use `Get-Module` to confirm the module loaded.

Use `Get-Module -ListAvailable` to see what PowerShell can find on disk.

### List available commands

```powershell
Get-Command -Module Privesc
```

Replace `Privesc` with the imported module name.

If you are unsure, run `Get-Module` first.

### Read command help

```powershell
Get-Help Get-System
Get-Help Get-System -Examples
```

Start with examples when you need syntax fast.

### Common workflow

1. Transfer the module or script.
2. Extract it into a readable path.
3. Import it from the local path.
4. List commands.
5. Run the function you need.

### Notes

* A module does not need to live in the global modules directory.
* Importing from the current folder is often enough.
* If Windows blocks a downloaded file, run `Unblock-File <path>` first.
