> For the complete documentation index, see [llms.txt](https://cajac.gitbook.io/ctf-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cajac.gitbook.io/ctf-notes/prog/powershell/search-for-cmdlets.md).

# Search for cmdlets

## List cmdlets

You can lists all cmdlets for all modules with

```powershell
help -Category Cmdlet
Get-Help -Category Cmdlet
```

`Help` is a built-in function that is essentially a wrapper around the `Get-Help` cmdlet with *interactive paging*. This is the preferred way of getting help.

## Search for cmdlets&#x20;

### Searching with Get-Help

To search for cmdlets relating to events with `Get-Help`

```powershell
help *event*
Get-Help *event*
```

This will search in both the cmdlets name and description.

### Searching with Get-Command

To search for cmdlets with specific `Noun`

```powershell
Get-Command -Noun Event
gcm -noun *proc*
```

`gcm` is just an alias for `Get-Command`.

To search for all cmdlets with a specific `Verb`

```powershell
Get-Command -Verb New
gcm -Verb Get
gcm -Verb re*
```

To search for all cmdlets related to services

```powershell
Get-Command *service*
Get-Command *service* -CommandType Cmdlet
```

## Resources

Get-Command - Microsoft Learn: <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/get-command?view=powershell-5.1>

Get-Help - Microsoft Learn: <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/get-help?view=powershell-5.1>
