As an IT professional working for a client in the United States, I recently encountered a situation where I needed to standardize the naming convention of folders across multiple directories. PowerShell is perfect for this. In this tutorial, I will explain how to use PowerShell to rename folders to uppercase or lowercase.
Now, let me explain everything with examples.
Rename Folders to Uppercase Using PowerShell
To rename folders to uppercase using PowerShell, you can use the Get-ChildItem cmdlet to retrieve the folders and then pipe them to the Rename-Item cmdlet. Here’s an example:
Get-ChildItem -Directory | ForEach-Object {
Rename-Item $_.FullName -NewName $_.Name.ToUpper()
}
Let’s break down this code:
Get-ChildItem -Directoryretrieves all the folders in the current directory.- The results are piped (
|) to theForEach-Objectcmdlet, which processes each folder individually. Rename-Itemis used to rename the folder, with the following parameters:- $_.FullName represents the full path of the current folder.
- -NewName specifies the new name for the folder.
- $_.Name.ToUpper() converts the current folder name to uppercase.
For example, if you have folders named “new york”, “los angeles”, and “chicago”, running this command will rename them to “NEW YORK”, “LOS ANGELES”, and “CHICAGO”, respectively.
Here is an example:
Get-ChildItem -Directory -Path "C:\MyFolder" | ForEach-Object {
Rename-Item $_.FullName -NewName $_.Name.ToUpper()
}
I executed the above PowerShell script, and you can see the exact output in the screenshot below:

Rename Folders in Subdirectories
To rename folders in subdirectories as well, you can add the -Recurse parameter to the Get-ChildItem cmdlet:
Get-ChildItem -Directory -Recurse | ForEach-Object {
Rename-Item $_.FullName -NewName $_.Name.ToUpper()
}
This command will traverse all subdirectories and rename any folders found to uppercase.
Check out How to Rename Multiple Files Using PowerShell?
Rename Folders to Lowercase Using PowerShell
To rename folders to lowercase, you can use a similar approach, but with the ToLower() method instead of ToUpper():
Get-ChildItem -Directory | ForEach-Object {
Rename-Item $_.FullName -NewName $_.Name.ToLower()
}
This command will rename folders like “NEW YORK”, “LOS ANGELES”, and “CHICAGO” to “new york”, “los angeles”, and “chicago”, respectively.
Here is an example:
Get-ChildItem -Directory -Path "C:\MyFolder" | ForEach-Object {
Rename-Item $_.FullName -NewName $_.Name.ToLower()
}
The exact output is in the screenshot below after I executed the PowerShell script above using VS code.

Rename Folders in Subdirectories to Lowercase
To include subdirectories when renaming folders to lowercase, use the -Recurse parameter with Get-ChildItem:
Get-ChildItem -Directory -Recurse | ForEach-Object {
Rename-Item $_.FullName -NewName $_.Name.ToLower()
}
Read How to Check if a File Exists and Rename it Using PowerShell?
Rename Folders to Uppercase or Lowercase Using PowerShell Examples
Now, let me show you some more examples of renaming folders to uppercase or lowercase using PowerShell.
- Renaming folders in a specific directory:
Get-ChildItem -Directory -Path "C:\Users\FewLines\Documents" | ForEach-Object {
Rename-Item $_.FullName -NewName $_.Name.ToUpper()
}
This command renames folders in the “C:\Users\FewLines\Documents” directory to uppercase.
- Renaming folders matching a specific pattern:
Now, let me show you how to rename folders with a matching specific pattern using PowerShell.
Get-ChildItem -Directory -Filter "*project*" | ForEach-Object {
Rename-Item $_.FullName -NewName $_.Name.ToLower()
}
This command renames folders containing the word “project” in their name to lowercase.
- Renaming folders with a specific file extension:
Here is a complete PowerShell script to rename folders with a specific file extension.
Get-ChildItem -Directory -Recurse | Where-Object { $_.Name -like "*.bak" } | ForEach-Object {
Rename-Item $_.FullName -NewName $_.Name.ToUpper()
}
This command renames folders with the “.bak” extension to uppercase, including those in subdirectories.
Conclusion
In this tutorial, I explained how to rename folders to uppercase or lowercase using PowerShell. By using the Get-ChildItem and Rename-Item cmdlets, you can automate the process of standardizing folder names across your file system. Whether you need to rename folders in a specific directory, match a particular pattern, or include subdirectories, you can use PowerShell to achieve this.
You may also like the following tutorials:
- Download a File from URL Using PowerShell
- How To Check If File Modified In Last 24 Hours Using PowerShell?
- How to Create a Folder If Not Exists in PowerShell?

Hey! I’m Bijay Kumar, founder of SPGuides.com and a Microsoft Business Applications MVP (Power Automate, Power Apps). I launched this site in 2020 because I truly enjoy working with SharePoint, Power Platform, and SharePoint Framework (SPFx), and wanted to share that passion through step-by-step tutorials, guides, and training videos. My mission is to help you learn these technologies so you can utilize SharePoint, enhance productivity, and potentially build business solutions along the way.