Can the select-Object be used like so to match either?
If ((Get-content $file | select-object -last 1) -match 'deleted' -or 'return'){"yes"} else {"No"}
This doesn't produce error but will tell me yes regardless of the last string matched in $file. I would like to do display a Yes if either match.
You can use alternation in the regex:
If ((Get-content $file | select-object -last 1) -match 'deleted|return'){"yes"} else {"No"}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With