Read Valid Input in PowerShell


Previously, any time I wanted to validate input in PowerShell, I’d write custom validation functionality per-script. It turns out that I reuse the same basic methods though, so I’ve created and shared a generalised function!

This prompts users to enter input that matches a displayed list, then returns their input if successful. This works from VM or object selection, to simple y/n acceptance restrictions.

The full details and code are here: https://github.com/GSGBen/powershell/blob/master/Read-ValidInput.psm1

To make it accessible to your code save it somewhere then use import-module <path to above file>

image

Videogames

Hey, do you like videogames? If so please check out my game Grab n' Throw on Steam, and add it to your wishlist. One gamemode is like golf but on a 256 km^2 landscape, with huge throw power, powerups, and a moving hole. Another is like dodgeball crossed with soccer except instead of balls you throw stacks of your own teammates. And there's plenty more!

See full gameplay on Steam!