PowerShell is a powerful shell and scripting language for managing Windows systems. It offers access to COM, WMI, .NET, and can automate nearly any system task. Unlike CMD, PowerShell works with objects instead of plain text.
๐น Key Cmdlets (PowerShell Commands):
Get-Command - List all available commands Get-Help <cmdlet> - Show help about a command Set-Location - Change directory (cd equivalent) Get-Location - Print current directory (pwd) Clear-Host - Clear screen (cls) Get-ChildItem - List items in current directory (ls)
๐งช Examples:
Get-Command Set-Location C:\Users Get-ChildItem
๐ก Note:
Use Get-Help for command syntax. PowerShell uses Cmdlets with Verb-Noun naming.
๐น Cmdlets:
New-Item - Create file or directory Remove-Item - Delete files/folders Move-Item - Move files/folders Copy-Item - Copy files/folders Get-Content - View contents of a file Set-Content - Overwrite content in a file Add-Content - Append content to a file
๐งช Examples:
New-Item -Path . -Name test.txt -ItemType File Add-Content -Path test.txt -Value "hello world" Get-Content .\test.txt
๐ฅ Tip:
Use -Recurse to include subdirectories and -Force to override.