Power Shell | Cookbook

Filesystem

List of files in a folder
(ls -r *.txt).fullname
Delete files with pattern
Get-ChildItem *.code -recurse | foreach { Remove-Item -Path $_.FullName }

Searching in Files

Get-ChildItem -Recurse | Select-String "dummy" -List | Select Path
Get-ChildItem -Recurse *.sql | Select-String "create .*_tab_" | Select-Object -Unique Path

Environment

Show env variablesgci env:* | sort-object nam
Show env variables with valuesgci env:*
Show env variables with name patterngci env: | where name -like '*HOME'

Permissions

Show current policy
Get-ExecutionPolicy
Allow custom scripts to execute
Set-ExecutionPolicy -Scope CurrentUser unrestricted

From Bash to Powershell

which

(get-command FILE.EXE).Path
Set-Alias where Get-Command
where FILE.EXE