Skip to main content

Posts

Showing posts from September, 2017

Useful Powershell stuff

Short:
ii = Invoke-Item - for files, opens them using windows default program
vim = Opens with vim (custom alias)
csi = C# interactive (custom alias)
$whatever | Format-List = get a list of every property and value for an object


& { blah } 1 > $null    - suppress standard output from executing "blah". More info
$var = & Do-Stuff *>&1  - redirect all output to standard output and store that in $var

get-content .\somefile -Wait  - tail-like behaviour, displays additions to the file

Getting a count of duplicated things:
$whatever | group FieldToGroup | where Count -gt 1 | sort Count -Descending | select Name, Count