# Bash Best Practices
#!/bin/bash
set -e -u
tar -czf archive.tar.gz /dir
if cmd; then echo "OK"; fi
find /dir -mtime +14 -delete
# PowerShell Best Practices
Get-CimInstance Win32_LogicalDisk | Where-Object {$_.DriveType -eq 3}
Select-Object DeviceID, @{n='Name';e={$_.Prop}}
try { cmd } catch { Write-Host "Err" -ForegroundColor Red }