Windows commands
Files, ACLs, archives, and processes from PowerShell first. A few cmd.exe verbs remain common. Execution policy is a guardrail, not a suggestion to switch off.
Windows admin at a keyboard is mostly PowerShell. Verb-Noun cmdlets are discoverable, pipeable, and scriptable. cmd.exe still appears in older docs and muscle memory — dir and cd work — but prefer the PowerShell forms below when you are writing something that will be shared or repeated.
First principles
PowerShell objects travel down the pipeline, not just text. Get-ChildItem returns items you can filter; Format-* is for display at the end. Paths may be case-insensitive on NTFS, but do not rely on that in scripts you might port. Execution policy controls which scripts run; RemoteSigned is a common workstation default. Unrestricted for convenience is how unsigned scripts become routine.
Navigate and move files
Get-Location
Set-Location C:\Logs
Get-ChildItem -Force
Copy-Item .\src .\dest -Recurse
Move-Item .\old.txt .\new.txt
Remove-Item .\file.txt
Get-Content .\notes.txt -Tail 50
Get-PSDriveAliases exist: ls, cd, cat, pwd map to these cmdlets. In scripts, write the full names. Get-PSDrive shows drives and providers — useful when a letter is missing or a PSDrive is a network share. cmd.exe still uses dir, cd, copy, move, del, type; fine interactively, weaker for structured output.
Permissions (ACL)
Get-Acl .\file.txt | Format-List
(Get-Acl .\file.txt).Access
icacls .\folder
icacls .\folder /grant DOMAIN\User:(OI)(CI)MGet-Acl / Set-Acl are the PowerShell objects. icacls remains the common CLI for inheritance-aware grants and inheritance repair. Prefer a named group over a personal account on shared folders. Do not grant Everyone Full Control to clear an error.
Archives
Compress-Archive -Path .\folder -DestinationPath .\bundle.zip
Expand-Archive -Path .\bundle.zip -DestinationPath .\outCompress-Archive cannot set a password. For a password wrap, use 7-Zip AES as in the password-protected zip guide. Expand-Archive is for simple zip trees.
Processes
Get-Process
Get-Process | Sort-Object CPU -Descending | Select-Object -First 15
Stop-Process -Id 1234
Stop-Process -Name notepad -WhatIfStop-Process ends the process. -WhatIf shows what would happen. Task Manager and Resource Monitor are the GUI peers; the cmdlets above are what you put in a script.
Execution policy and the Terminal
Get-ExecutionPolicy -List
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
# Win+X then Windows Terminal, or:
wt.exeDo not set Unrestricted machine-wide to make one script run. Prefer RemoteSigned for CurrentUser, or unblock a single downloaded script with Unblock-File. Windows Terminal (Win+X on current builds) is the preferred host over legacy consoles when it is installed.
House rules
- Write full cmdlet names in shared scripts. Aliases are for interactive typing.
- Do not Set-ExecutionPolicy Unrestricted casually. Scope the change and prefer RemoteSigned.
- ACL changes belong to groups and inheritance you can explain. Everyone:Full is a failure mode.
- Remove-Item -Recurse deletes for real. Confirm the path. Recycle Bin is Explorer behaviour, not the default for every CLI delete.
Informed by Microsoft Learn — PowerShell.
