Skip to content

Instantly share code, notes, and snippets.

@kevinblumenfeld
Last active June 23, 2017 23:12
Show Gist options
  • Save kevinblumenfeld/249f10623865b2e1814c65b2828dc93c to your computer and use it in GitHub Desktop.
Save kevinblumenfeld/249f10623865b2e1814c65b2828dc93c to your computer and use it in GitHub Desktop.
$hash = @{}
$text = 'lorem ipsum dolor sit amet consectetur adipiscing elit'
-split $text | ForEach-Object {
write-host "3: $3"
write-host "U: $_"
$1 = $2
$2 = $3
$3 = $_
write-host "3: $3"
write-host "U: $_"
$Key = @($1, $2)
if (-not $hash.ContainsKey($Key)) {
$hash[$Key] = new-object -TypeName System.Collections.ArrayList
}
$hash[$Key] = ($3)
}
$hash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment