This article explores a PowerShell function that simplifies user prompts using the $host.ui.PromptForChoice method. By restricting input to predefined options, the function ensures accuracy and ease of use. It returns 0 for No and 1 for Yes, with customizable parameters for the prompt's title, message, and default selection.

I’m an IT professional who has worked for distributers and several MSP’s for over 15 years. My main focus is on the Microsoft Cloud but have a deep knowledge in Exchange, Active Directory and core Windows infrastructure. I’m a lover of craft beer and going to live music events. I’m also on a mission to slowly make my home smarter.