Hello All, I am trying to write a short script to make filter and get the full path of the parent folder with "S3080130" in it. I have tried the followings
Get-ChildItem -Path C:\test-v\ -Directory -Recurse | Select-String -Pattern S3080130
S3080130 abcde
While if I perform this
Get-ChildItem -Path C:\test-v\ -Directory -Recurse | FT FullName
Return the followings
C:\test-v\Group3\IVYY2\S3080130 abcde
C:\test-v\Group3\IVYY2\S3080130 abcde\PRM
C:\test-v\Group3\IVYY2\S3080130 abcde\PRM\01 BCK
C:\test-v\Group3\IVYY2\S3080130 abcde\PRM\02 ENG
C:\test-v\Group3\IVYY2\S3080130 abcde\PRM\03 SDR
C:\test-v\Group3\IVYY2\S3080130 abcde\PRM\04 DDR
C:\test-v\Group3\IVYY2\S3080130 abcde\PRM\05 COY
and return all other folders as well
Can I just return the following instead if I only need to filter out S3080130* folder but without its subfolders ?
C:\test-v\Group3\IVYY2\S3080130 abcde
Thanks
Peter