0% found this document useful (0 votes)
39 views

Windows-PowerShell-Commands-List

Uploaded by

romiosavager
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

Windows-PowerShell-Commands-List

Uploaded by

romiosavager
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Windows PowerShell Commands and Cmdlets Cheat

Sheet (PDF)
technastic.com/windows-powershell-commands-list/

Basics of Windows PowerShell


Below are some basic PowerShell terms and shortcut keys you should know, especially if
you are a beginner. It is easy to launch this command-line tool but there are 17 ways to
open PowerShell in Windows 10 and 11.

Alias: An alternate or shorter name for a cmdlet, script, function, or executable file.
Cmdlet: Commands built into shell written in .NET Framework.
Ctrl + C: Cancel the current command.
F7: Shortcut key to view command history in a window.
Functions: Commands written in PowerShell language.
Home/End: Shortcut key to move to the start/end of a line.
Insert: Shortcut key to toggle between insert/overwrite mode.
Left/right arrow: Navigate the cursor.
Ctrl + left/right arrow: Navigate a word at a time.
Up/down arrow: Move up and down through history.
Pipelines: A series of commands connected by pipeline operators ( | ).
Parameter: Arguments to a cmdlet/function/script.
Scripts: Text files with ps1 extension.
Tab/Shift-Tab: Shortcut key to complete commands as you type them.
Variable: A unit of memory in which the data is stored. Variables usually start with a
$ sign and include spaces and special characters.

Don’t Miss: 250+ Windows Keyboard Shortcuts You Must Use

List of PowerShell Commands and Cmdlets

Command name/Cmdlet Alias Description

Add-Content ac Adds content to the specified files. For


instance, you can add words to a file.

Add-PSSnapIn asnp Adds PowerShell snap-ins to the current


session.

Clear-Content clc Deletes the contents of a file while retaining


the file.

Clear-History clhy Deletes specific entries from the command


history.

1/8
Clear-Host cls, clear Removes all text (commands and output)
from the current display.

Clear-ItemProperty clp Clears the value of a property.

Clear-Variable clv Clears the value of a variable.

Compare-Object compare, Compares two sets of objects directly by


dif generating reports on the differences
between the objects.

Connect-PSSession cnsn Reconnects to the disconnected sessions.

Copy-Item copy, cp, Copies files and folders from a source file
cpi path to the destination file path.

Copy-ItemProperty cpp Copies the value of a property from a


specified location to another location.

Disable-PSBreakpoint dbp Disables the breakpoints in the current


PowerShell console.

Disconnect-PSSession dnsn Disconnects from a PowerShell session.

Enable-PSBreakpoint ebp Enables the breakpoints in the current


PowerShell console.

Enter-PSSession etsn Starts a PowerShell session with a remote


computer.

Exit-PSSession exsn Ends a PowerShell session with a remote


computer.

Export-Alias epal Exports information about currently defined


aliases to a file.

Export-Csv epcsv Converts objects into a series of character-


separated values and saves the strings in a
CSV file.

Export-PSSession epsn Exports cmdlets and functions from another


session on a computer and saves them in a
PowerShell module.

ForEach-Object %, Performs modification or formatting on every


foreach item in a specified group of input objects (or
items).

Format-Custom fc Uses a customized view to display objects


while retaining their basic structure.

Format-List fl Formats the output of a command as a list of


properties, showing each property on a new
line.

Format-Table ft Formats the output into table form.

2/8
Get-Alias gal Gets the alias names for the cmdlets,
functions, and scripts for the current session
in PowerShell. If you want to find out or
check the alias for a specific cmdlet, you can
use Get-Alias -Definition cmdlet-
name or gal -d cmdlet-name.

Get-ChildItem gci, dir, ls Gets the files and folders from one or more
specified locations, such as a file system
directory, registry hive, or certificate store.

Get-Command gcm Displays the list of all PowerShell commands


and functions.

Get-Content gc, type Gets the contents from a file without opening
it and returns each text file line as a string
object.

Get-Date Gets the current date and time.

Get-Help Helps you to get to know all the


PowerShell commands, their parameters,
functions, scripts, workflows, etc.

Get-History h, ghy, Displays the list of the previous commands


history used in the current session.

Get-HotFix Gets hotfixes or updates that have been


installed on either the local computer or
remote computer.

Get-Item gi Gets files and folders at the specified


location but doesn’t get the contents of the
item unless you use a wildcard (*).

Get-ItemProperty gp Gets the registry entries or values in the


readable format in the console.

Get-Job gjb Gets the list of jobs running in the


background, and those that have completed
in the current session.

Get-Location gl, pwd Gets an object that represents the current


directory within PowerShell.

Get-Member gm Displays the properties, methods, and


different members of an object.

Get-Module gmo Displays the list of all the modules that are
loaded behind the scene. You can use the
cmdlet Get-Module -ListAvailable to view
the list of all available modules. A module is
a collection of cmdlets, variables, functions,
and workflows.

3/8
Get-PSBreakpoint gbp Retrieves all current breakpoints that are set
in the current session. This cmdlet can help
you debug PowerShell.

Get-PSCallStack gcs Displays the call stack or all commands


executed in the current session. With this
cmdlet, you can see a history of all
commands run as part of a single execution
step.

Get-PSDrive gdr Displays the variety of drives exposed by


Windows PowerShell in the current session.

Get-PSSession gsn Displays the sessions created in the current


Windows PowerShell session on local and
remote computers.

Get-PSSnapIn gsnp Displays the Windows PowerShell snap-in.

Get-Process ps, gps Retrieves the list of all running applications


and processes on a local or remote
computer. It shows the process owner, the
process ID, or even where on disk the
process is located.

Get-Service gsv Displays the list of all installed services, their


status (such as running or stopped), and
startup type on a local or remote computer.
You can use parameters to include or
exclude services.

Get-Unique gu Returns unique items from a sorted list.


PowerShell cmdlet Select-Object -Unique
does the same job but it’s a bit different
because it does not require objects to be
pre-sorted.

Get-Variable gv Displays the names and the values of the


PowerShell variables in the current console.

Get-WmiObject gwmi Searches for different WMI (Windows


Management Instrumentation) classes on a
system. Using this cmdlet, you can get any
information about a Windows computer and
its components.

Group-Object group Groups similar objects together based on


common properties.

Import-Alias ipal Imports an alias list from a specified file in


PowerShell.

Import-Csv ipcsv Fetch the information contained in a CSV file


and create a table-like structure.

4/8
Import-Module ipmo Imports modules to the current session.

Import-PSSession ipsn Imports command from a remote computer


into the current session.

Invoke-Command icm Runs a command or a script and returns the


results as an expression on a local or remote
computer.

Invoke-Expression iex Runs a specified string as a command on


the local computer.

Invoke-History r, ihy Runs commands from the command history


in the current session.

Invoke-Item ii Runs or opens the specified item (depending


on the file type) in the program associated
with the file type.

Invoke-RestMethod irm Sends HTTP or HTTPS requests using


various HTTP methods to REST API
endpoints. It is an alternative to Invoke-
WebRequest.

Invoke-WMIMethod iwmi Launches a create process WMI(Windows


Management Instrumentation) method of the
WIN32_Process class.

Invoke-WebRequest curl, iwr, Sends HTTP, HTTPS, FTP, and FILE


wget requests to a web page or web service on
the Internet.

mkdir md Creates a new directory.

Measure-Object measure Measures how large an object is by


calculating the numeric properties of the
object in terms of characters, words, and
lines.

Move-Item mi, mv, Moves a file, folder, or registry along with its
move properties, contents, and child items from
one location to another location.

Move-ItemProperty mp Moves the property of an item from one


place to another.

New-Alias nal Creates a new alias.

New-Item ni Creates a new item.

New-Module nmo Creates a dynamic module from a script


block.

5/8
New-PSDrive ndr, Creates a new temporary or persistent drive
mount with various Windows PowerShell provider
types. To create a new PSDrive you’ll need
to provide a drive name, the provider, and
the location.

New-PSSession nsn Creates a persistent connection to a local or


remote computer.

New- npssc Creates a persistent PowerShell connection


PSSessionConfigurationFile to a local or remote host.

New-Variable nv Creates a new variable by simply assigning it


a value.

Out-GridView ogv Displays data as an interactive table (the


GUI format) that can be filtered or sorted
based on different criteria.

Out-Host oh Sends output to the Windows PowerShell


host for display.

Out-Printer lp Sends output to the connected printer.

Pop-Location popd Changes the current location to the path at


the top of the directory stack.

Push-Location pushd Pushes or adds the current location to the


top of a location stack called ‘Paths’ and sets
the C:\Program Files\PowerShell\ directory
as the current directory.

Receive-Job rcjb Fetches the results of Windows PowerShell


background jobs, such as those started by
using the Start-Job cmdlet.

Receive-PSSession rcsn Fetches the results of PowerShell sessions


that were disconnected intentionally using
the Disconnect-PSSession cmdlet.

Remove-Item del, Deletes items from specific locations like


erase, files, folders, registry keys, variables, and
rd, ri, rm, functions. You can use parameters to include
rmdir or exclude items. You can use this command
to delete files with very long names using
PowerShell.

Remove-ItemProperty rp Deletes registry values and stored data of an


item.

Remove-Job rjb Deletes a Windows PowerShell background


job. Deletes n stopped or completed
background job in PowerShell, You need to
mention the ‘-id n’ or ‘-name xxx’ to specify
the job you want to remove.

6/8
Remove-Module rmo Deletes module objects (cmdlets and
functions) from the PowerShell session.

Remove-PSBreakpoint rbp Disables the breakpoint from the current


console so they are not hit when the script
runs.

Remove-PSDrive rdr Removes temporary PowerShell drives


created with New-PSDrive. To remove
multiple drives together, you should separate
them using a comma (,).

Remove-PSSession rsn Closes PowerShell sessions, stops any


running commands in the current session,
ends the PSSession, and also closes the
connection between the local and remote
computers.

Remove-PSSnapin rsnp Unloads a snap-in from the current


PowerShell session.

Remove-Variable rv Removes the variable and its value defined


in PowerShell.

Remove-WMIObject rwmi Removes a WMI (Windows Management


Instrumentation) class.

Rename-Item ren, rni Renames items such as files and directories


in a PowerShell provider namespace.

Rename-ItemProperty rnp Renames an item’s property without


changing its value.

Resolve-Path rvpa Resolves the wildcard characters in a path


and displays the items and containers at the
location specified by the path.

Resume-Job rujb Resumes a suspended job.

Select-Object select Selects specific properties from an object or


dataset.

Select-String sls Searches for text and text patterns in input


strings and files.

Set-Alias sal Creates or changes an alias (alternate


name) for a cmdlet or other command
element in the current PowerShell session.

Set-Content sc Writes or replaces the content in an item with


new content.

Set-Item si Changes the value of an item to the value


specified in the command.

7/8
Set-ItemProperty sp Sets the value of the property of the
specified object.

Set-Location cd, chdir, Changes the current directory or location to


sl a location you specify.

Set-PSBreakpoint sbp Sets the line breakpoint in the script.

Set-Variable set, sv Assigns a value to a variable or changes the


current value. If the specified variable
doesn’t exist, the cmdlet will create it.

Show-Command shcm Lets you find the parameters and syntax of


other PowerShell cmdlets graphically.

Sort-Object sort Sorts objects in ascending or descending


order based on the values of properties.

Start-Job sajb Starts a Windows PowerShell background


job without interacting with the current
session.

Start-Process saps, Starts single or multiple processes on the


start local computer.

Start-Service sasv Start one or more stopped services on the


system.

Start-Sleep sleep Suspends the activity in a script or session


for a certain period of time.

Stop-Job spjb Stops all or stop selected jobs based on their


name, ID, instance ID, or state.

Stop-Process kill Forcibly kills or stops the running processes.

Suspend-Job sujb Suspends workflow jobs by temporarily


interrupting or pausing them.

Wait-Job wjb Suspends the command prompt until the


PowerShell background tasks running in the
session are complete.

Where-Object ?, where Filters objects based on their property


values.

Write-Output echo, Sends any object or data type, such as


write strings, integers, arrays, and complex
objects to the next command in the pipeline.

8/8

You might also like