#switch returning the same 1st condition

1 messages · Page 1 of 1 (latest)

candid turret
#

you need an explicit comparison with $_ if you're using { } notation. $_ is the current item in switch.

#

otherwise, if you just want a direct match on the regex provided, remove { }.
So ```ps
switch -regex ($processedgame) {
'(.*)gl2' { $matches[1] }