Guide to the main PowerShell commands for Windows

PowerShell commands are an essential tool for anyone who wants to manage, automate, and customize Windows from the command line. Known as cmdlets , these commands allow you to perform numerous operations on files, folders, systems, and networks, often more efficiently than the classic MS-DOS Command Prompt .

In this guide, you will discover the most used PowerShell commands , their abbreviations (aliases), and the differences between cmdlets and aliases , providing a useful overview for both beginners and those already working in the IT world.

In short

  • PowerShell commands automate and simplify Windows management.
  • Cmdlets are unique commands, often also available via shorter aliases.
  • Some commands can be invoked both by alias and as cmdlets, others only as cmdlets.

Index

  • What is PowerShell and what is it used for?
  • How to open PowerShell
  • How to close PowerShell
  • Possibility and integration
  • PowerShell Commands: Aliases and Cmdlets
  • PowerShell commands available only as cmdlets
  • Conclusions
  • Frequently Asked Questions (FAQ)

What is PowerShell and what is it used for?

PowerShell is a console designed by Microsoft in 2006 to facilitate advanced management of Windows operating systems. Thanks to its cmdlets , PowerShell allows you to automate complex tasks, manage system resources, and interact with internal or external components with the support of COM (Component Object Model) and WMI (Windows Management Instrumentation). Its flexibility makes it suitable for both simple daily tasks and more complex scripts and workflows.

How to open PowerShell

Starting PowerShell is easy on Windows 7, Windows 10, and Windows 11 systems . If you’re using an older version, such as Windows XP or Vista , you can rely on the initial releases of PowerShell (1.0 or 1.0 RC2). On newer systems, just follow these simple steps:

  • Search for “ powershell ” in the Start menu.
  • Press Enter to open the PowerShell terminal window.

PowerShell is not available in very early versions of Windows, where you must use the classic Command Prompt.

How to close PowerShell

To exit PowerShell, you can do two quick things:

  • Click on the “ X ” at the top right of the window.
  • Type the command exit and press Enter on the keyboard.

Possibility and integration

PowerShell isn’t limited to a standalone interface: it can be integrated into applications to take advantage of its administration and scripting capabilities. Its default presence on Windows 7 , 10, and 11 makes it a valuable ally for anyone who wants deeper control over Windows.

PowerShell Commands: Aliases and Cmdlets

PowerShell offers the ability to use some commands with either their full name (cmdlet) or an alias, which is a more convenient shortened version when typing. Here are the main useful commands to know:

  • Add-Content (alias: ac ) – Adds content, such as text, to a file.
  • Get-Content (alias: cat , gc , type ) – Displays the contents of a file.
  • Set-Location (aka: cd , chdir ) – Changes the current folder.
  • Clear-Content (alias: clc ) – Clears the contents of a file without deleting the file itself.
  • Clear-Host (alias: clear , cls ) – Clears the console screen.
  • Clear-Item (alias: cli ) – Clears the contents of an item.
  • Clear-ItemProperty (alias: clp ) – Clears the value of a property.
  • Clear-Variable (alias: clv ) – Clears the value of a variable.
  • Connect-PSSession (alias: cnsn ) – Reconnects a disconnected PowerShell session.
  • Compare-Object (alias: compare , diff ) – Compare two objects.
  • Copy-Item (aka: copy , cp , cpi ) – Copies files or folders.
  • Invoke-WebRequest (alias: curl , iwr ) – Retrieves content from a web page.
  • Disable-PSBreakpoint (aka: dbp ) – Disable breakpoints in the PowerShell console.
  • Remove-Item (aka: del , erase , rd , ri , rm , rmdir ) – Delete files or folders.
  • Disconnect-PSSession (aka: dnsn ) – Disconnects a PowerShell session.
  • Enable-PSBreakpoint (alias: ebp ) – Enable breakpoints in the PowerShell console.
  • Write-Output (aka: echo ) – Show or send output to the pipeline.
  • Export-Csv (alias: epcsv ) – Exports data in CSV format.
  • Enter-PSSession (alias: etsn ) – Starts a remote session.
  • Exit-PSSession (alias: exsn ) – Closes a remote session.
  • ForEach-Object (alias: foreach ) – Executes commands on each received object.
  • Format-Table (alias: ft ) – Displays output in table format.
  • Get-Alias ​​(alias: gal ) – Shows available aliases.
  • Get-ChildItem (alias: ls , dir , gci ) – List files and folders.
  • Get-Command (alias: gcm ) – Shows available commands.
  • Get-History (aka: ghy , h , history ) – Show command history.
  • Get-Job (aka: gjb ) – Show background jobs.
  • Get-Location (alias: gl , pwd ) – Shows the current directory.
  • Get-Member (alias: gm ) – Show properties and methods of an object.
  • Get-ItemProperty (alias: gp ) – Shows the properties of an item.
  • Get-Process (alias: gps , ps ) – Shows active processes.
  • Get-PSSnapIn (alias: gsnp ) – Shows installed PowerShell snap-ins.
  • Get-Service (alias: gsv ) – Shows available or running services.
  • Get-Unique (alias: gu ) – Returns unique values ​​from a sorted list.
  • Invoke-Command (alias: icm ) – Executes local or remote commands.
  • Invoke-Expression (alias: iex ) – Executes a command or expression.
  • Invoke-History (alias: ihy ) – Executes a command already in the history.
  • Import-Alias ​​(alias: ipal ) – Import aliases from a file.
  • Import-Module (alias: ipmo ) – Imports a PowerShell module.
  • Invoke-RestMethod (alias: irm ) – Makes requests to REST APIs.
  • Stop-Process (alias: kill ) – Terminates a specified process.
  • Out-Printer (alias: lp ) – Sends data to the printer.
  • help (alias: man ) – Displays information about PowerShell commands.
  • mkdir (alias: md ) – Creates a new directory.
  • Measure-Object (aka: measure ) – Counts objects, lines, words, or characters.
  • Move-Item (alias: mi , move , mv ) – Moves files or folders.
  • New-Alias ​​(alias: nal ) – Creates a new alias.
  • New-PSDrive (alias: mount , ed. ) – Creates a PowerShell drive or network drive.
  • New-Item (alias: ni ) – Creates files, folders, or registry keys.
  • New-PSSession (alias: nsn ) – Creates a new persistent PowerShell session.
  • New-Variable (alias: nv ) – Creates a new variable.
  • Out-Host (alias: oh ) – Send output to the console.
  • Remove-PSBreakpoint (aka: rbp ) – Removes a breakpoint.
  • Receive-PSSession (alias: rcsn ) – Retrieve results from a disconnected session.
  • Remove-PSDrive (aka: rdr ) – Removes a PowerShell drive.
  • Rename-Item (alias: ren , rni ) – Renames files or folders.
  • Remove-Job (aka: rjb ) – Removes a background job.
  • Remove-PSSession (alias: rsn ) – Closes a PowerShell session.
  • Remove-Variable (alias: rv ) – Removes a variable.
  • Start-Job (aka: sajb ) – Starts a job in the background.
  • Start-Process (alias: saps ) – Starts a process or program.
  • Start-Service (alias: sasv ) – Starts a Windows service.
  • Set-PSBreakpoint (aka: sbp ) – Creates a breakpoint.
  • Set-Content (alias: sc ) – Replaces the contents of a file.
  • Select-Object (alias: select ) – Selects properties or objects.
  • Set-Variable (alias: set ) – Sets or creates a variable.
  • Stop-Service (alias: spsv ) – Stops a Windows service.

PowerShell commands available only as cmdlets

Some PowerShell commands don’t have aliases; they can only be invoked using their full name. These commands offer advanced and specialized features:

  • # – Comments out a line of code, preventing it from being executed.
  • & – Runs a PowerShell command, function, or script.
  • Break – Immediately breaks a loop or control structure.
  • Debug-Process – Adds debugging to a process.
  • Enable-PSRemoting – Enables remote PowerShell command execution.
  • Export-Console – Exports the console configuration to a file.
  • For – Loops through elements that meet certain conditions.
  • ForEach – Loops through all elements of a collection.
  • Get-Culture – Displays regional and linguistic information about your computer.
  • Get-Date – Shows the current date and time.
  • Get-Event – ​​Retrieves events from the PowerShell session queue.
  • Get-Host – Displays information about the PowerShell host.
  • New-Event – ​​Creates a new event in the PowerShell session.
  • New-Object – Creates a new .NET object.
  • Out-File – Saves the output of a command to a file.
  • Pause – Suspends execution and waits for user input.
  • PowerShell – Start a PowerShell session or run a script.
  • Register-ScheduledJob – Creates a scheduled job.
  • Restart-Computer – Restarts your computer.
  • Restart-Service – Stops and restarts a service.
  • Remove-Event – ​​Removes an event from the session queue.
  • Send-MailMessage – Send an email message.
  • Set-Date – Sets your computer’s date and time.
  • Set-ExecutionPolicy – ​​Manages permissions for running scripts.
  • Test-Path – Checks if a file or path exists.
  • Try – Catch – Executes code and handles any errors.
  • Unregister-ScheduledJob – Deletes a scheduled job.
  • While – Runs a loop as long as a condition is true.
  • Write-Host – Show custom output in the console.
  • Write-Progress – Displays a progress bar.
  • Zipfile – Compresses or extracts Zip files.

Conclusions

PowerShell commands extend the capabilities of managing the Microsoft operating system professionally and efficiently. Knowing how to use them also means being able to automate multiple aspects of Windows configuration and maintenance.

Leave a Comment

Scroll to Top