PowerShell Cheatsheet

PowerShell commands with params - little ref

Page content

Here’s a little cheatsheet: PowerShell main commands with params

awesome seashell This awesomely powerfull seashell image is produced by AI model Flux 1 dev.

Basic Commands

  • Get-Command: Lists all available commands
  • Get-Help <cmdlet>: Displays help information for a specific cmdlet
  • Get-Process: Lists all running processes
  • Get-Service: Lists all services
  • Get-ChildItem (alias: ls, dir): Lists items in the current directory
  • Set-Location (alias: cd): Changes the current directory
  • Clear-Host (alias: cls): Clears the console screen

File and Directory Management

  • New-Item (alias: ni): Creates a new file or directory
  • Copy-Item: Copies files and directories
  • Move-Item: Moves files and directories
  • Remove-Item (alias: rm): Deletes files and directories
  • Rename-Item (alias: rnp): Renames a file or directory
  • Get-Content (alias: gc): Displays the content of a file

System Administration

  • Start-Process (alias: saps): Starts one or more processes
  • Stop-Process: Stops one or more running processes
  • Start-Service: Starts one or more services
  • Stop-Service: Stops one or more running services
  • Restart-Computer: Restarts the computer
  • Get-WinEvent: Displays Windows event logs
  • Checkpoint-Computer: Sets a restore point on your machine

Network Commands

  • Test-Connection: Sends ICMP echo request packets to one or more computers
  • Invoke-WebRequest (alias: curl, wget): Gets content from a web page
  • Get-NetAdapter: Retrieves network adapters
  • Get-NetIPAddress: Gets IP address configuration

User and Security Management

  • Get-LocalUser: Lists local user accounts
  • New-LocalUser: Creates a new local user account
  • Set-LocalUser: Modifies a local user account
  • Remove-LocalUser: Deletes a local user account
  • Get-Acl: Gets the security descriptor for a resource

PowerShell Scripting

  • Set-ExecutionPolicy: Sets the PowerShell execution policy
  • Get-Variable: Gets the variables in the current console
  • Set-Variable (alias: set, sv): Sets a variable’s value
  • Remove-Variable (alias: rv): Deletes a variable
  • ForEach-Object: Performs an operation on each item in a specified collection
  • Where-Object: Selects objects with specific properties

Job Management

  • Start-Job (alias: sajb): Starts a PowerShell background job
  • Get-Job: Gets PowerShell background jobs running in the current session
  • Receive-Job: Gets the results of background jobs
  • Stop-Job: Stops a PowerShell background job
  • Wait-Job: Waits until one or all of the PowerShell background jobs are complete

Output Formatting

  • Format-Table: Formats output as a table
  • Format-List: Formats output as a list
  • Out-File: Sends output to a file
  • Export-Csv: Exports objects to a CSV file
  • ConvertTo-Json: Converts an object to a JSON-formatted string

Use Get-Help <cmdlet> for detailed information on any command, including its parameters and usage examples.

Other Cheatsheets