Created
June 22, 2020 23:43
-
-
Save sean-m/02ab04b055b527ae26fcdeb936b96c5a to your computer and use it in GitHub Desktop.
helper for using Linq zip in powershell, short enough to write manually but easier to paste one that already behaves.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Zip { | |
param ([object[]]$first, [object[]]$second) | |
[Func[object,object,object]]$zipper = { param ($a, $b) New-Object PSObject -Property @{First=$a;Second=$b} } | |
[System.Linq.Enumerable]::Zip($first, $second, $zipper) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment