Powershell Tips
Contents
List Directory Contents
Get-ChildItem
Get-ChildItem
can accept filters:Get-ChildItem -Filter "*.txt"
to list all text file
Change Directories
Set-Location <path>
Get Current directory
Get-Location
Move item
Move-Item <path> <destination>
Download a file
(New-Object System.Net.WebClient).DownloadFile("<url>")
Pager
- Pipe the output of a command into
Out-Host -Paging
- Example:
Get-ChildItem | Out-Host -Paging
Init file
$HOME/Documents/PowerShell/Microsoft.PowerShell_profile.ps1