xutil.dev
Login

PowerShell Cheatsheet

PowerShell commands cheatsheet for server and network administration

94 commands

Get-ChildItem

List files and folders

Copy-Item

Copy files or folders

Move-Item

Move or rename files/folders

Remove-Item

Remove files or folders

New-Item

Create a new file or folder

Get-Content

Read file contents

Set-Content

Write content to a file (overwrite)

Add-Content

Append content to a file

Test-Path

Check if a path exists

Get-ItemProperty

Get properties of a file or registry key

Compress-Archive

Compress files into a ZIP archive

Expand-Archive

Extract a ZIP archive

Test-NetConnection

Test network connectivity and ports

Get-NetIPAddress

Display IP address configuration

Get-NetAdapter

List network adapters

Resolve-DnsName

Perform DNS name resolution

Get-NetTCPConnection

List TCP connections

Get-NetRoute

Display routing table

New-NetIPAddress

Set a new IP address

Set-DnsClientServerAddress

Set DNS server address

Test-Connection

Send ICMP ping requests

Invoke-WebRequest

Send an HTTP request

Invoke-RestMethod

Send a request to a REST API

Get-Process

List running processes

Stop-Process

Stop a process

Start-Process

Start a new process

Get-Service

List services and their status

Start-Service

Start a service

Stop-Service

Stop a service

Restart-Service

Restart a service

Set-Service

Change service properties

Get-Job

List background jobs

Start-Job

Start a background job

Get-ComputerInfo

Get detailed computer information

Get-EventLog

Get event log entries

Get-WinEvent

Get Windows event log entries

Get-HotFix

List installed hotfixes/updates

Get-WmiObject

Get WMI object information

Get-CimInstance

Get CIM instance (WMI successor)

Get-Counter

Get performance counter data

Get-Date

Get and format current date/time

Get-Uptime

Display system uptime

Get-WindowsFeature

List Windows features and roles

Install-WindowsFeature

Install a Windows feature

Get-LocalUser

List local users

New-LocalUser

Create a local user

Remove-LocalUser

Remove a local user

Set-LocalUser

Modify local user properties

Get-LocalGroup

List local groups

Add-LocalGroupMember

Add a member to a local group

Remove-LocalGroupMember

Remove a member from a local group

Get-LocalGroupMember

List members of a local group

Get-Volume

Display volume information

Get-Disk

List disks

Get-Partition

Display partition information

Get-PSDrive

List PowerShell drives

New-Partition

Create a new partition

Format-Volume

Format a volume

Initialize-Disk

Initialize a disk

Get-PhysicalDisk

Get physical disk information

Get-NetFirewallRule

List firewall rules

New-NetFirewallRule

Create a new firewall rule

Remove-NetFirewallRule

Remove a firewall rule

Set-NetFirewallRule

Modify a firewall rule

Enable-NetFirewallRule

Enable a firewall rule

Disable-NetFirewallRule

Disable a firewall rule

Get-NetFirewallProfile

Display firewall profile settings

Set-NetFirewallProfile

Configure firewall profile

Enter-PSSession

Start an interactive remote session

Exit-PSSession

End a remote session

Invoke-Command

Run commands on remote computers

New-PSSession

Create a persistent remote session

Get-PSSession

List remote sessions

Remove-PSSession

Remove a remote session

Enable-PSRemoting

Enable PowerShell remoting

Copy-Item -ToSession

Copy files to a remote session

Get-IISSite

List IIS websites

Start-IISSite

Start an IIS website

Stop-IISSite

Stop an IIS website

New-IISSite

Create a new IIS website

Get-IISAppPool

List IIS application pools

Import-Module WebAdministration

Import the IIS management module

Get-WebBinding

Display website binding information

New-WebBinding

Add a binding to a website

Get-ADUser

Search Active Directory users

New-ADUser

Create an AD user

Set-ADUser

Modify AD user properties

Remove-ADUser

Remove an AD user

Get-ADComputer

Search AD computer objects

Get-ADGroup

Search AD groups

Add-ADGroupMember

Add a member to an AD group

Get-ADGroupMember

List members of an AD group

Get-ADOrganizationalUnit

List AD organizational units

Unlock-ADAccount

Unlock a locked AD account