Created
August 27, 2018 21:17
-
-
Save shaneis/ba4204b8f014d666ed2a1dd551928650 to your computer and use it in GitHub Desktop.
Yes or No
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#region Test-ListeningConfirm | |
function Test-ListeningConfirm { | |
[CmdletBinding()] | |
param( | |
[int[]]$Numbers | |
) | |
process { | |
foreach ($num in $Numbers) { | |
$keepGoing = Read-Host "Are you sure you want to process: [$num] (Y/N)" | |
if ($keepGoing -eq 'Y') { | |
"Current number: [$num]" | |
} else { | |
break | |
} | |
} | |
} | |
} | |
Test-ListeningConfirm -Numbers $Numbers | |
#endregion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment