Powershell One Liners
Instead of making a post every time I stumble upon a cool powershell one liner, I'll combine them all in this post. If you have a better one liner for my tasks, please comment. Kill a process by name (In this case Jenkins). Get-Process | ? {$_.Name -like 'JenKins' } | Stop-Process Delete all Duplication Downloads (I usually run it first without the del paramaters) dir -r | ? {$_.Name -like '(1)' } | del Powershell 3, Where/ForEach hack - allowing you to specify properties sans an anonymous expression. dir -r | ? Name -like '(1)' Restart Explorer (often auto-hide of taskbar gets stuck, restarting explorer fixes it.) Get-Process | where name -eq explorer |kill ; explorer Find Who's hogging memory Get-Process | sort "VM" -Des | Select-Object -first 10 Set current time forward 4 hours set-date ((get-date) + [TimeSpan]::FromHours(4.0)) Get my son's age in weeks ((g...