Show-Input
Last updated
PS master:\> Show-Input "Please provide your email" -DefaultValue "my@email.com" -Validation "^[a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$" -ErrorMessage "Not a proper email!"PS master:\> $contentItem = get-item master:\content
PS master:\> $newName = Show-Input "Please provide the new name for the '$($contentItem.Name)' Item" -DefaultValue $contentItem.Name -Validation "^[\w\*\$][\w\s\-\$]*(\(\d{1,}\)){0,1}$" -ErrorMessage "Invalid characters in the name"
#print new name
PS master:\> Write-Host "The new name you've chosen is '$($newName)'"Show-Input "Please provide 5 characters at most" -MaxLength 5