Powershell Child Item Question

in Scripting
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
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
Comments
-
JDMurray Admin Posts: 12,991 Admin
Have you tried using the ToUpper() method of the String object?
Forum Admin at www.techexams.net
--
LinkedIn: www.linkedin.com/in/jamesdmurray
Twitter: www.twitter.com/jdmurray -
HighlanderSword Member Posts: 2 ■■□□□□□□□□
how do i do that when doing a select properties, i triedGet-ChildItem "D:\" -Recurse | select name | select @{n='name';e={$_.toupper()}} and it returned no data at all
-
JDMurray Admin Posts: 12,991 Admin
You need to specify the 'name' field you want to call the ToUpper method in.$_.name.ToUpper()
Forum Admin at www.techexams.net
--
LinkedIn: www.linkedin.com/in/jamesdmurray
Twitter: www.twitter.com/jdmurray