Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

Match results

$
0
0

I use the following (with another pattern of course)  to match filenames in a directory.

$test= gci "c:\" | Select Name |  Select-String -Pattern ".*" 
 

As a result i get matchinfo-object like this:

@{Name=Examplefolder}

 

But how do i get just the real result ( in this case "Examplefolder").

Nothing seems to work, e.g.: $test[0].matches.value  or  $test[0].name

 

Thanks, hill


http://www.administrator.de/





Viewing all articles
Browse latest Browse all 2562

Trending Articles