I'm trying to filter out service accounts in a file containing user accounts, one per line:
"svc.test"
"test.user"
"test.user2"
Select-String adds unwanted metadata:
C:\Output> select-string -Path C:\Output\tmp.csv 'svc' -NotMatch
tmp.csv:415:"test.user"
tmp.csv:416:"test.user2"
I just want:
"test.user"
"test.user2"
How do I do this?
--- Update --- Here is the result of the Get-Member cmdlet:
PS C:\Output> select-string -Path C:\Output\tmp.csv 'svc' -NotMatch|get-member
TypeName: Microsoft.PowerShell.Commands.MatchInfo
Name MemberType Definition
---- ---------- ----------
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
RelativePath Method string RelativePath(string directory)
ToString Method string ToString(), string ToString(string directory)
Context Property Microsoft.PowerShell.Commands.MatchInfoContext Context {get;set;}
Filename Property string Filename {get;}
IgnoreCase Property bool IgnoreCase {get;set;}
Line Property string Line {get;set;}
LineNumber Property int LineNumber {get;set;}
Matches Property System.Text.RegularExpressions.Match[] Matches {get;set;}
Path Property string Path {get;set;}
Pattern Property string Pattern {get;set;}
I need the data. How do I output the line property data to a file?