Total Pageviews

Featured Post

CI/CD +playwright

  Playwright CI/CD Using Azure DevOps (ADO) – Step by Step Step 1: Prerequisites Make sure you have: Azure DevOps project Git repo with Play...

Thursday, December 18, 2025

Powershell commands handy

 File & Folder Commands

Alias Full Cmdlet Usage Example Description

ls Get-ChildItem ls -Force Lists files and folders (like Linux ls)

dir Get-ChildItem dir *.log Alias maintained for CMD users

gci Get-ChildItem gci -Recurse Shorthand for listing

cd Set-Location cd C:\Windows Change directory

chdir Set-Location chdir .. Same as cd

pwd Get-Location pwd Shows current directory

cp Copy-Item cp file.txt D:\Backup\ Copies files/folders

copy Copy-Item copy a.txt b.txt CMD-style alias

mv Move-Item mv old.txt new.txt Moves or renames items

move Move-Item move file1 folder\ Same as mv

rm Remove-Item rm temp.txt Deletes files/folders

del Remove-Item del *.tmp CMD-style delete

rmdir Remove-Item rmdir folder -Recurse Deletes folder & contents

ni New-Item ni file.txt -ItemType File Creates new file or folder

mkdir New-Item mkdir NewFolder Creates folder

md New-Item md Backup Short mkdir

cat Get-Content cat file.txt Displays file content (like Linux cat)

gc Get-Content gc config.json Shorthand for reading files

type Get-Content type notes.txt CMD-style alias

sc Set-Content sc file.txt "New text" Overwrites file content

ac Add-Content ac file.txt "More text" Appends to file


🟨 2. Execution & Opening

Alias Full Cmdlet Usage Example Description

ii Invoke-Item ii . Opens file or folder with default program

start Start-Process start notepad.exe Launches processes or files

sleep Start-Sleep sleep 5 Pauses for X seconds

saps Start-Process saps calc Shorthand for start process

gps Get-Process gps chrome Lists processes

ps Get-Process ps CMD-like process list

kill Stop-Process kill -Name notepad Kills a process by name or ID


🟩 3. Navigation & Info

Alias Full Cmdlet Usage Example Description

help Get-Help help ls Shows help for a cmdlet

man Get-Help man Get-Process Linux-style help

h Get-History h Shows command history

history Get-History history Same as h

cls Clear-Host cls Clears console screen

clear Clear-Host clear Linux-style clear

echo Write-Output echo Hello Prints text to console

write Write-Output write "done" Same as echo


πŸŸͺ 4. Networking & System

Alias Full Cmdlet Usage Example Description

ipconfig (external) CMD utility ipconfig /all Shows network info

netstat (external) CMD utility netstat -ano Lists network connections

hostname (external) CMD utility hostname Displays computer name

ping (external) CMD utility ping 8.8.8.8 Tests network connectivity

tracert (external) CMD utility tracert google.com Traces route to host

πŸ‘‰ These aren’t PowerShell cmdlets but work inside PowerShell as external commands.


πŸŸ₯ 5. Miscellaneous Aliases

Alias Full Cmdlet Usage Example Description

% ForEach-Object `1..5 % { $_*2 }`

? Where-Object `gci ? { $_.Length -gt 1MB }`

sort Sort-Object `ls sort Length`

measure Measure-Object `ls measure`

select Select-Object `gps select Name,Id`

foreach ForEach-Object `ls foreach { $_.Name }`


πŸ“ Quick Reference Summary

Common Alias Real Cmdlet Equivalent (Linux/CMD)

ls Get-ChildItem ls (Linux) / dir (CMD)

cd Set-Location cd

pwd Get-Location pwd

cp Copy-Item cp / copy

mv Move-Item mv / move

rm Remove-Item rm / del

cat Get-Content cat / type

ii Invoke-Item (like double-click)

% ForEach-Object for loops

? Where-Object grep-like filtering