Guest User

Untitled

a guest
Sep 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. function Test-Prompts {
  2.  
  3. do {
  4. [string]$Path = Read-Host -Prompt 'Enter the location of the folder.'
  5. } until (Test-Path -Path $Path)
  6.  
  7.  
  8. do {
  9. [int]$Number = Read-Host -Prompt 'Enter a number from 1 to 10.'
  10. } until ($Number -ge 1 -and $Number -le 10)
  11.  
  12. do {
  13. [string]$Set = Read-Host -Prompt 'Choose a set of Set1, Set2, or Set3.'
  14. } until ($Set -in 'Set1', 'Set2', 'Set3')
  15.  
  16. [PSCustomObject]@{
  17. Path = $Path
  18. Number = $Number
  19. Set = $Set
  20. }
  21. }
Add Comment
Please, Sign In to add comment