1.6. Case Insensitivity
In PowerShell, cmdlet names are case-insensitive. In general, cmdlet parameter information is generally also case-insensitive, although there are cases where this is not the case.
All PowerShell cmdlet names, in the verb-noun form are case-insensitive. Similarly, all named parameters have parameter names that are case-insensitive. For example, to retrieve information about available commands you can use:
get-command
or:
Get-Command
or any other variant of the name using mixed case.
The Windows operating system does not consider case significant in filenames. So, any time that you use a filename as an argument to a PowerShell command, case is not significant by default. For example, to redirect the current date and time to a file named Text.txt on drive C:, use the following command, which includes redirection:
get-date > C:\Test.txt
The > character is the redirection operator, which redirects output from the screen (the default) to some specified target—in this case, a file on drive C:.
An exception to the general rule of no case-sensitivity is when you use class names from the .NET Framework. PowerShell allows you work directly with classes from the .NET Framework. I discuss this in more detail in Chapter 13.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access