ImmyBot Commands with Variables that Contain $

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!

Which task is this for? Maybe the password box is using string datatype instead of password. I know variables get resolved in string text boxes, but I didn’t think they did in password boxes

This is for a custom task I made. You can pull up the ActivTrak software and view both the Version Detection script and Download Installer script to see how credentials are pulled from IT Glue.

It uses an IT Glue API key stored in an Azure vault to access an IT Glue and pulls credentials based on the web page’s ID.

Example from ActivTrak script:
if ($ITGluePasswordID) {

$Params = @{
    ITGPasswordID  = $ITGluePasswordID
    ITGBaseURL     = $ITGBaseURL
    VaultURIString = $VaultURIString
}

$Credentials = Get-ITGluePasswordAsCredential @Params
$ATUsername = $Credentials.UserName
$ATPassword = $Credentials.GetNetworkCredential().Password

}

@Aaron_Colon So does it work correctly in ActivTrak, or is there the same issue? I noticed that it is using the [Password] datatype in the configuration task, so maybe passwords do have an issue. If that’s the case, I would bring this up to support with an example.