Powershell Split Operator
Had a problem with -split of a string variable that contained a "." (period) in it. Discovered from this article that a period as a regular expression means 'any character', so you must escape the period with a "\".
For example: $a,$b = $member.SamAccountName -split('\.')
See: Article - Powershell Split Operator
Tuesday, February 14, 2017
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment