How to find Powershell commands
There are a couple of ways to find commands in PowerShell, depending on whether you’re looking for something specific or browsing for possibilities
1. Get-Command:
This cmdlet is your go-to tool for discovering available commands. Here’s how to use it:
- List All Commands:
PowerShell
Get-Command
This will display a list of all cmdlets, functions, and aliases currently available in your session.
- Find Commands by Name (including wildcards):
PowerShell
Get-Command Get-*
This will search for commands that start with “Get-“. You can use wildcards like “*” to broaden your search.
- Filter by Type:
PowerShell
Get-Command -CommandType Cmdlet
This will list only cmdlets (not functions or aliases). You can replace “Cmdlet” with “Alias” or “Function” to filter by those types.
2. Online Resources:
- Microsoft Docs: The official PowerShell documentation is a treasure trove of information. You can search for specific cmdlets or browse by category: https://learn.microsoft.com/en-us/powershell/
- PowerShell Gallery: This online repository contains community-developed cmdlets and modules that extend PowerShell’s functionality. You can search for cmdlets by name or function: https://learn.microsoft.com/en-us/powershell/gallery/overview?view=powershellget-3.x
3. Tab Completion:
PowerShell offers tab completion to help you discover commands and parameters as you type. Simply start typing a command name and press the Tab key. PowerShell will suggest possible completions based on what you’ve entered so far.
4. Get-Help:
Once you’ve found a potential command, use Get-Help
to learn more about it.
PowerShell
Get-Help Get-Process
This will provide detailed information about the Get-Process
cmdlet, including its syntax, parameters, and examples.