Powershell Child Item Question
HighlanderSword
Member Posts: 2 ■■□□□□□□□□
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
-
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: 13,099 AdminYou need to specify the 'name' field you want to call the ToUpper method in.$_.name.ToUpper()