On Windows 10 and more presumably on PoSh 5, you have to escape the brackets.
Here you are for example : $namePlaceHolder = "\ [DISPLAY_NAME\ ]"
Tested in ISE and on a GPO logon script and it worked like a charm.
PS: due to comments generated in markdown, you have to delete the extras white spaces after the escape characters.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
On Windows 10 and more presumably on PoSh 5, you have to escape the brackets.
Here you are for example : $namePlaceHolder = "\ [DISPLAY_NAME\ ]"
Tested in ISE and on a GPO logon script and it worked like a charm.
PS: due to comments generated in markdown, you have to delete the extras white spaces after the escape characters.