Welcome to Shaun Luttin's public notebook. It contains rough, practical notes. The guiding idea is that, despite what marketing tells us, there are no experts at anything. Sharing our half-baked ideas helps everyone. We're all just muddling thru. Find out more about our work at bigfont.ca.

Daily Office PowerShell

Tags: powershell, productivity

Get-History

history | group { $_.CommandLine }

history | where { $_.CommandLine - like "*foobar*" }

history | group { $_.CommandLine } | select count, name

history | group { $_.CommandLine } | sort count -desc | % { write-host "$($_.Count):$($_.Name)" }

Get-ChildItem

gci -Include "*.ext" -Recurse | % { $_.FullName }

gci -recurse -include "Temporary ASP.NET Files" | select FullName

dir | sort CreationTime | select -first 10

Copy-Item

copy-item .\foo\bar\foobar.zip C:\users\my.user\documents

Misc

& 7z e Foobar.zip -oFoobar The ampersand allows the command to start with a number. The -o switch touches the destination directory.