Home
General
Scripting
Powershell Child Item Question
HighlanderSword
When using get-childitem is there a way to upper case the selected results .
so for my example I'm returning the file name , I want to convert just the results of the below to uppercase as some files are in mixed case
Get-ChildItem "D:\*.*" -Recurse|select Name
Find more posts tagged with
Comments
JDMurray
Have you tried using the ToUpper() method of the String object?
HighlanderSword
how do i do that when doing a select properties, i tried
Get-ChildItem "D:\" -Recurse | select name | select @{n='name';e={$_.toupper()}} and it returned no data at all
JDMurray
You need to specify the 'name' field you want to call the ToUpper method in.
$_.name.ToUpper()
Quick Links
All Categories
Recent Posts
Activity
Unanswered
Groups
Best Of