PowerShell Commands for System Administration | TechNomadiX
Post

PowerShell Commands for System Administration

PowerShell has become an essential tool for system administrators, allowing for task automation and efficiency in daily operations. Below, I’ve curated a comprehensive list of PowerShell commands frequently used in administrative tasks, along with a detailed description of each one. Whether you’re a DevOps specialist or a project manager, understanding these commands will empower you to manage systems effectively and drive quality through automation.


PowerShell Commands Library

CommandAlias/Alternative NamesDescriptionType
Get-ChildItemdir, gci, lsRetrieves files and folders in a file system drive.Cmdlet
Invoke-CommandicmExecutes commands on local and remote computers.Cmdlet
Import-ModuleipmoLoads modules into the current session.Cmdlet
Export-CsvepcsvConverts objects into CSV format and saves them to a file.Cmdlet
Write-Host Outputs customized messages to the console.Cmdlet
Get-WmiObjectgwmiRetrieves WMI class instances or information about available classes.Cmdlet
Get-Contentcat, gc, typeFetches the content of a file.Cmdlet
Get-Date Returns the current date and time.Cmdlet
Invoke-WebRequestcurl, iwr, wgetRetrieves content from a web page.Cmdlet
Start-Processsaps, startInitiates one or more processes on the local machine.Cmdlet
Copy-Itemcopy, cp, cpiCopies an item from one location to another.Cmdlet
Set-ExecutionPolicy Sets the PowerShell script execution policy for the user session.Cmdlet
Out-File Directs output to a file.Cmdlet
Where-Object?, whereSelects objects from a collection based on property values.Cmdlet
Import-CsvipcsvConverts CSV data into table-like custom objects.Cmdlet
Send-MailMessage Sends an email.Cmdlet
New-Object Instantiates a .NET Framework or COM object.Cmdlet
Select-StringslsSearches for text in files and strings.Cmdlet
Remove-Itemdel, erase, rd, ri, rm, rmdirDeletes files and directories.Cmdlet
Select-ObjectselectChooses objects or object properties.Cmdlet
Test-Path Checks if a path exists.Cmdlet
Invoke-RestMethodirmSends HTTP/HTTPS requests to RESTful web services.Cmdlet
Install-Package Installs software packages.Cmdlet
ForEach-Object%, foreachPerforms actions on each item in a collection.Cmdlet
Write-Outputecho, writeSends objects to the pipeline or displays them in the console.Cmdlet
Get-Processgps, psLists processes running on local or remote machines.Cmdlet
Get-ServicegsvRetrieves services from a local or remote computer.Cmdlet
Format-TableftPresents output as a table.Cmdlet
Test-Connection Sends ICMP echo requests (“ping”) to a computer.Cmdlet
New-ItemniCreates a new item (file, folder, etc.).Cmdlet
Get-EventLog Fetches events from the event log.Cmdlet
Get-WinEvent Gathers events from event logs and tracing logs.Cmdlet

These commands are instrumental in achieving system tasks in a versatile and agile manner, proving especially useful within the DevOps paradigm. Using these PowerShell commands, project managers and DevOps specialists can greatly enhance system automation, reduce human error, and improve the overall quality of system administration tasks.


CMD PS


Mastering these commands not only makes systems administration more efficient but also supports agile methodologies by enabling rapid changes, facilitating easy monitoring, and providing extensive scripting capabilities that are adaptable to various operational needs. Through automation and scripting, teams can continuously improve quality and reliability while fostering an environment conducive to constant learning and development.

These commands form the foundation of efficient scripting and automation, essential for any DevOps professional or project manager focused on quality and adaptability.

This post is licensed under CC BY 4.0 by the author.