- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to convert the content of the file into uppercase or lowercase?
To convert the content of the file into the upper case, you need to use the method ToUpper() and to convert into lower case, you need to use ToLower() method.
Upper case example
(Get-Content D:\Temp\PowerShellaliases.txt).ToUpper()
Output
PS C:\WINDOWS\system32> (Get-Content D:\Temp\PowerShellaliases.txt).ToUpper() COMMANDTYPE NAME VERSION SOURCE ----------- ---- ------- ------ ALIAS % -> FOREACH-OBJECT ALIAS ? -> WHERE-OBJECT ALIAS AC -> ADD-CONTENT ALIAS ASNP -> ADD-PSSNAPIN ALIAS CAT -> GET-CONTENT ALIAS CD -> SET-LOCATION ALIAS CFS -> CONVERTFROM-STRING 3.1.0.0 MICROSOFT.POWERSHELL.UTILITY ALIAS CHDIR -> SET-LOCATION ALIAS CLC -> CLEAR-CONTENT ALIAS CLEAR -> CLEAR-HOST ALIAS CLHY -> CLEAR-HISTORY ALIAS CLI -> CLEAR-ITEM ALIAS CLP -> CLEAR-ITEMPROPERTY ALIAS CLS -> CLEAR-HOST
Lower case example
(Get-Content D:\Temp\PowerShellaliases.txt).ToLower()
Output
PS C:\WINDOWS\system32> (Get-Content D:\Temp\PowerShellaliases.txt).ToLower() commandtype name version ----------- ---- ------- alias % -> foreach-object alias ? -> where-object alias ac -> add-content alias asnp -> add-pssnapin alias cat -> get-content alias cd -> set-location alias cfs -> convertfrom-string 3.1.0.0 alias chdir -> set-location alias clc -> clear-content alias clear -> clear-host alias clhy -> clear-history alias cli -> clear-item alias clp -> clear-itemproperty alias cls -> clear-host alias clv -> clear-variable alias cnsn -> connect-pssession alias compare -> compare-object alias copy -> copy-item alias cp -> copy-item alias cpi -> copy-item alias cpp -> copy-itemproperty alias curl -> invoke-webrequest alias cvpa -> convert-path alias dbp -> disable-psbreakpoint alias del -> remove-item alias diff -> compare-object alias dir -> get-childitem
- Related Articles
- Convert string to lowercase or uppercase in Arduino
- How to convert lowercase letters in string to uppercase in Python?
- How to convert all the records in a MySQL table from uppercase to lowercase?
- How to convert all uppercase letters in string to lowercase in Python?
- Java program to convert a string to lowercase and uppercase.
- Golang Program to convert Uppercase to Lowercase characters, using binary operator.
- Conversion of whole String to uppercase or lowercase using STL in C++
- How to convert a string into uppercase in AngularJS?
- Write a C program to convert uppercase to lowercase letters without using string convert function
- How to check whether a string is in lowercase or uppercase in R?
- Making a Java String All Uppercase or All Lowercase.
- How to read file content into istringstream in C++?
- How to test if a letter in a string is uppercase or lowercase using javascript?
- How to retrieve the content of the file in PowerShell?
- Convert all lowercase characters to uppercase whose ASCII value is co-prime with k in C++

Advertisements