========= YesNo.ps1 ======================================= 
 Name: YesNo.ps1 
 Purpose: Demonstrate how to ask the user a question with a Yes or No Answer using PowerShell 
 Author: Dan Stolts - dstolts$microsoft.com - http://ITProGuru.com 
 Syntax/Execution: Copy portion of script you want to use and paste into PowerShell (or ISE)  
 Description: Collect a Yes or No Response from the user using PowerShell 
 Disclaimer: Use at your own Risk!  See details at http://ITProGuru.com/privacy  
         * Must Run PowerShell (or ISE)  
        * UAC may get in the way depending on your settings (See: http://ITProGuru.com/PS-UAC) 
# Yes/No From the command line  
Write-host "Would you like to download your PublishSettings File to connect to Azure? (Default is No)" -ForegroundColor Yellow 
    $Readhost = Read-Host " ( y / n ) " 
    Switch ($ReadHost) 
       Y {Write-host "Yes, Download PublishSettings"$PublishSettings=$true} 
       N {Write-Host "No, Skip PublishSettings"$PublishSettings=$false} 
       Default {Write-Host "Default, Skip PublishSettings"$PublishSettings=$false} 
# video of Script https://channel9.msdn.com/Series/GuruPowerShell 
# More scripts from Dan Stolts "ITProGuru" at http://ITProGuru.com/Scripts


Demonstrate how to ask the user a question with a Yes or No Answer using PowerShell. Collect a Yes or No Response from the user using PowerShell. Use a Switch (like case) statement to evaluate the results.  Includes showing the DEFAULT response.


Brought to you by ITProGuru Dan Stolts.

Blog: http://ITProGuru.com

Script Home: http://ITProGuru.com/Scripts

Accompanying Video on Channel 9 at https://channel9.msdn.com/Series/GuruPowerShell