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

Select-STring ohne Dateiname und ggf. ohne Zeilennr

$
0
0

kennt jemand einen Parameter dass man bei select-string keinen Dateinamen in der Zeile zurückbekommt.

$treffer = select-string -path "c:\temp\test.txt" -pattern "0123456" 
$x = $treffer.ToString().Substring().IndexOf(':')
$x

result 

C:\temp\test.txt:2:\\dies ist der Text vom Logfile usw.\MapiHttp_2018090915-1.LOG:8:2018-09

richtig wäre

\\dies ist der Text vom Logfile usw.\MapiHttp_2018090915-1.LOG:8:2018-09


Chris


Viewing all articles
Browse latest Browse all 2314

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>