Monthly Archives: April 2016

Using a directory array for a choice menu inside a function

Usage of [System.Management.Automation.Host.ChoiceDescription[]] and $host.ui.PromptForChoice() with an array of data for choices. Default behavior when using functions is that the return value is every output, so when you want to return a value, using Write-Host inside the function will mess the return value up. The scenario is I wanted the user to provide a name,… Read More »