Heh ;p.
I was pleasantly surprised by how easy it was to pretty much do a 1:1 port of simple logic like that, though

.
I was prepared for much much worse, and then, it just... kind of flowed, and it worked?

.
When I started thinking about my options, my first though went to Go, but I've never actually worked in Go, so then I went with: I'll try to PoC it in shell first, and then go (ha!) from there. And once that was done, I went: wait, I can probably do that with PowerShell, right? And voilą ;p.