Created
September 20, 2018 20:56
-
-
Save shaneis/30ac864fa606a49274ac159e12eb3747 to your computer and use it in GitHub Desktop.
Prompts only
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
function Test-Prompts { | |
do { | |
[string]$Path = Read-Host -Prompt 'Enter the location of the folder.' | |
} until (Test-Path -Path $Path) | |
do { | |
[int]$Number = Read-Host -Prompt 'Enter a number from 1 to 10.' | |
} until ($Number -ge 1 -and $Number -le 10) | |
do { | |
[string]$Set = Read-Host -Prompt 'Choose a set of Set1, Set2, or Set3.' | |
} until ($Set -in 'Set1', 'Set2', 'Set3') | |
[PSCustomObject]@{ | |
Path = $Path | |
Number = $Number | |
Set = $Set | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment