Just had another thought on this: Does your $user variable’s value contain wildcards? If so, you’d need to change those -eq operators back to -like in my example (and that might also explain why it’s not working the way you expected with the original ScriptBlock syntax.)
↧