February 2019
Intermediate to advanced
626 pages
15h 51m
English
In this context, \ is an escape character, but it is perhaps more accurate to say that \ changes the behavior of the character that follows. For example, finding a string that contains the normally reserved character, *, may be accomplished using \, as follows:
'1 * 3' -match '\*'
In the following example, \ is used to escape the special meaning of \, making it a literal character:
'domain\user' -match 'domain\\user' 'domain\user' -match '.*\\.*'
This technique may be used with -replace to change the domain prefix:
'domain\user' -replace 'domain\\', 'newdomain\'
Using \ alone will result in either an invalid expression or an unwanted expression. For example, the following expression is valid, but it doesn't act ...
Read now
Unlock full access