Powershell: I feel like my code is kludgy, but can't figure out how to smoothen it.

Printable View