Skip to main content

Choice1

 

 

function OutputError([string]$errorMessage)
{
Write-Host $errorMessage -ForegroundColor Red
Read-Host 'Es ist ein Fehler aufgetreten.'
}

$title = 'something'
$question = 'Are you sure you want to proceed?'
$choices = '&Yes', '&No'

#$decision = $Host.UI.PromptForChoice($title, $question, $choices, 1)
$decision = $Host.UI.PromptForChoice('something','Are you sure you want to proceed?',$choices, 1)
if ($decision -eq 0) {
Write-Host 'confirmed'
} else {
Write-Host 'cancelled'
}


$Title = "Title"
$Info = "Pick Something!"
$options = echo Option1 Option2 Option3
$defaultchoice = 2
$selected = $host.UI.PromptForChoice($Title , $Info , $Options, $defaultchoice)
$options[$selected]

$Parent = Read-Host -prompt "Enter full parent path that will contain the new folder"

if ( ($Parent -eq $null) -or ($Parent -eq "") -or ($Parent -eq " ")) { Write-Host "You entered a blank value: This Script is now Exiting." }
else { Write-Host "You Entered $Parent" }