Anonymous user
Menu: Difference between revisions
→{{header|PowerShell}}
Line 2,108:
=={{header|PowerShell}}==
<lang PowerShell>
function Select-TextItem
Line 2,154 ⟶ 2,153:
End
{
if(!$inputObject){
return ""
}
do
{
Line 2,167 ⟶ 2,169:
Write-Host ("{0,3}: {1}" -f 0,"To cancel")
$selectedValue = ""
Line 2,175 ⟶ 2,177:
$selectedValue = $menuOptions[$choice - 1]
}
}
until ($choice -match "^[0-9]+$" -and ($choice -eq 0 -or $choice -le $menuOptions.Count))
return $selectedValue
|