I'm having difficulty formulating the regex statement as well as to itse placement in a powershell script to extract a value that is in brackets of a command in a series of files (missing documentation so we're extracting the possible pass values from a zillion files - don't ask, its my pain)
What I currently have is:
Get-ChildItem -Recurse -Include *.* | Select-String "getBackOfficeCmdObject\(" | Out-File C:\work\found.txt
now, this is selecting all the lines that contain "getBackOfficeCmdObject(", but I was hoping to get the unique/distinct values contained in the brackets.
So for clarity,
blah blah getBackOfficeCmdObject(val1) blah blah
blah blah getBackOfficeCmdObject(val2) blah blah
blah blah getBackOfficeCmdObject(val3) blah blah
blah blah getBackOfficeCmdObject(val1) blah blah
blah blah getBackOfficeCmdObject(val4) blah blah
blah blah getBackOfficeCmdObject(val2) blah blah
as the data set to work with, would result in a file with the results
val1
val2
val3
val4
selecting the unique values from the list.
Thanks