Windows PowerShell Basics
Essential PowerShell commands
Navigation
Get-Location # get current directory (pwd)
Set-Location path # change directory (cd)
Push-Location # save current location
Pop-Location # return to saved location
List Items
Get-ChildItem # list files and folders (ls)
Get-ChildItem -Force # show hidden files
Get-ChildItem -Recurse # list recursively
File Operations
New-Item file.txt # create new file
New-Item -ItemType Directory folder # create directory
Copy-Item source dest # copy file/folder
Move-Item source dest # move file/folder
Remove-Item file # delete file/folder
Rename-Item old new # rename item
Content
Get-Content file.txt # read file contents (cat)
Set-Content file.txt text # write to file
Add-Content file.txt text # append to file
Clear-Content file.txt # clear file contents
Search
Select-String pattern file # search in file (grep)
Get-ChildItem -Filter *.txt # filter by extension
Help
Get-Help command # get help for command
Get-Help command -Examples # show examples
Get-Command # list all commands