Open DemitasseNZ opened 9 years ago
$ is a special character in PowerShell, so handling it in strings is hard. Need to look at whether there is better way to pass string that doesn't cause $$ to be mangled
Meanwhile, you can add a routine to verify that the user don't use a password with $$. There must be something more critical than fixing this :)
The general solution is to use escaping function [regex]::escape() I'll need to look into whether this is useful for file reading. Another option is to document escaping for the entry in automate.ini https://blogs.technet.microsoft.com/heyscriptingguy/2016/09/30/powertip-how-to-escape-characters-in-a-string-using-regular-expressions/
When I build AutoLab and wait for the DC to ask me for password change and choose Pa$$w0rd123 (I choose this for temporal stuff), somehow the password that get into the B:\Automate\Hosts*.cfg its different, its missing a “$” (it ended being Pa$w0rd123). If I edit the password in automate.ini before the DC asked for it, everything goes fine and ended as expected.