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.
Get Professional Windows® PowerShell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.