UI/Get-FromUser.ps1
function Get-FromUser { Param($Message, $DefaultValue) $lastChar = $Message.substring($Message.length -1) Write-Host -NoNewLine "$Message" If ($DefaultValue){ Write-Host -NoNewLine " [$DefaultValue]" } If (!(".?!:" -match $lastChar)){ Write-Host -NoNewLine ": " } $r = Read-Host If ($r){ Return $r } else { Return $DefaultValue } } Export-ModuleMember -Function Get-FromUser |