DomainPasswordSpray
DomainPasswordSpray copied to clipboard
Variable reference is not valid
Update - If you don't need it, you can just delete or comment out the function timer and the script works fine.
After a recent update the script fails with the following error
Iex : At line:261 char:21
-
Write-Host "$Message: Waiting for $($Seconds/60) minutes. $($ ...
-
~~~~~~~~~
Variable reference is not valid. ':' was not followed by a valid variable name character. Consider using ${} to delimit the name. At line:1 char:1
- Iex (new-object net.webclient).downloadstring('https://raw.githubuser ...
-
+ CategoryInfo : ParserError: (:) [Invoke-Expression], ParseException + FullyQualifiedErrorId : InvalidVariableReferenceWithDrive,Microsoft.PowerShell.Commands.InvokeExpressionCommand
Alternatively, you can add a single space after $Message to fix the error. I believe that you simply can't have a variable followed by a colon without escaping it or using one of the special cases for colons. So changing line 261 to the following will make the script work:
Write-Host "$Message : Waiting for $($Seconds/60) minutes. $($ ...
Adding the space works perfectly. Thanks :)