Hi everyone,
First time poster here. New to ImmyBot and new to scripting in general. I am trying to refine a local user account creation script that pulls username and password information from IT Glue. It is working great except for with passwords that contain the $ special character. It seems that no matter what I do to try and force ImmyBot to not treat $ as a variable and just treat the password as text, it completely overlooks the $ and everything after it.
Consider the following example:
- Password in IT Glue - pass$word
- Variable - $LocalPassword = $Credentials.GetNetworkCredential().Password
- Command - Test-Credential -Username $LocalUsername -Password $LocalPassword
In the above example, ImmyBot see the password as “pass” and completely overlook the “$word” part of the password. I encounter the same issue when using any ImmyBot related commands or parameters, such as Invoke-ImmyCommand or $using:.
Some things I have tried:
- Putting $LocalPassword in quotes
- Using .Replace(‘$’,“`$”) to try and force ImmyBot to see $ as a literal ‘$’
- Using $params=@{$LocalPassword = $Credentials.GetNetworkCredential().Password}@
- Many other things similar to or variations of the above
Is it currently not possible to do this? If so, I can change this into a feature request as it would be useful to be able to force ImmyBot to treat $'s that are being output by a variable as a text string.
Thanks in advance!