How can I find strings that are in the format [Company Name]\username in a string array?
I think I need to use Regex but can’t seem to find a way to work.
How can I find strings that are in the format [Company Name]\username in a string array?
I think I need to use Regex but can’t seem to find a way to work.
If it’s a string array, you can use
[pre]
$StringArray | Select-String -Pattern “[Company Name]\username”
[/pre]