VMware Cloud Community
REED201110141
Contributor
Contributor
Jump to solution

Disabling the PowerShell Escape Character

I need to use Get-VMGuestNetworkInterface on about 100 VMs.  They are non-domain members created from the same template with the same local administrator account.  Unfortunately, the local administrator password uses the ` character.  The ` character is the PowerShell Escape Character.  The Escape Character will not allow itself to be included with a string value, so when I try to pass the -GuestPassword paramter, it does not include the ` character, the password is wrong, and authentication fails.  Does anyone know who to use the ` character as part of a string literal?

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Depends hwo you pass the string, in single quotes the backtick doesn't need to be escaped ('pass`word').

In double quotes, use the back-slash ("pass\`word")


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

Depends hwo you pass the string, in single quotes the backtick doesn't need to be escaped ('pass`word').

In double quotes, use the back-slash ("pass\`word")


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
REED201110141
Contributor
Contributor
Jump to solution

Thank you, that's it exactly.

0 Kudos