Don’t do that #4: Don’t ask the user to write in upper case

By | February 24, 2015

Don’t do that: You could write some scripts to other departments (ex: Helpdesk) and asks some input for the end user, let’s take this basic example:

$surname = Read-Host "Enter your surname (in UPPER case)"


Do that: Instead of requiring an action from the end user, it makes more sense to convert in upper case the input, it’s more reliable (the user could forget or ignore that):

$surname = Read-Host -Prompt 'Enter your surname'
$surname = $surname.ToUpper()

You should try to automate the more you can in order to be more efficient.


previous-buttonnext-button

2 thoughts on “Don’t do that #4: Don’t ask the user to write in upper case

  1. Pingback: Don't do that #3 : Multiple Write-Host to add new lines - Powershell Guru

  2. Pingback: Don't do that #5 : Specify the type of variable with Read-Host - Powershell Guru

Leave a Reply

Your email address will not be published. Required fields are marked *