Blog

Basic PowerShell commands

PowerShell is a cross-platform task automation solution composed of a command-line shell, a scripting language, and a configuration management framework. PowerShell runs on Windows, Linux, and macOS.

Get-Help

The Get-Help cmdlet serves as documentation, in other words, it displays help for commands
Get-Help command
Get-Help Get-Process

Get-Help parameters

parameter -Examples, displays examples of writing the command. parameter -Full, displays full cmdlet information
Get-Help Get-Process -Full

Get-Process

The Get-Process cmdlet displays a list of processes without having to run the Task Manager.
Get-Process

Get-History

Get-History cmdlet Displays a list of recently executed commands
Get-History

Get-Service

he Get-Process cmdlet displays all running services
Get-Service
Using the A* pramat, the command will list all services starting with the letter “A” >

Start-Job

The Start-Job cmdlet provides a PowerShell environment to run code or commands as a background job without user interaction.
Start-Job -ScriptBlock {Get-Process}

Set-Location

he Set-Location cmdlet sets the current directory to the directory specified in the command.
cmdlet Set-Location dir_patch

ConvertTo-HTML

Converts data to HTML
Get-Command | ConvertTo-Html > file_name.html

Export-CSV

The same as above, but we will get a csv file with a list of processes
get-process | Export-CSV c:\process.csv

Get-Command

The Get-Command cmdlet lists all available PowerShell commands.
Get-Command
More details about Get-Command can be found on the Microsoft website
Scroll to Top