Skip to content

Commit

Permalink
Add linebreaks to input
Browse files Browse the repository at this point in the history
  • Loading branch information
Rouzax committed May 17, 2024
1 parent 9e1fc67 commit 48c550b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions functions/Get-Input.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ function Get-Input {

# Loop until a valid input is provided (if Required switch is used)
while ($Required -and ($null -eq $UserInput -or $UserInput -eq '')) {
Write-Host "Required | " -ForegroundColor DarkRed -NoNewline
Write-Host "`nRequired | " -ForegroundColor DarkRed -NoNewline
$UserInput = Read-Host -Prompt $Message
$UserInput = $UserInput.Trim()
}

# If Required switch is not used, get input without validation
if (-not $Required) {
Write-Host "Optional | " -ForegroundColor DarkCyan -NoNewline
Write-Host "`nOptional | " -ForegroundColor DarkCyan -NoNewline
$UserInput = Read-Host -Prompt "$Message"
$UserInput = $UserInput.Trim()
}
Expand Down

0 comments on commit 48c550b

Please sign in to comment.