Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Variable reference is not valid #31

Open
kpomeroy1979 opened this issue Jan 6, 2022 · 2 comments
Open

Variable reference is not valid #31

kpomeroy1979 opened this issue Jan 6, 2022 · 2 comments

Comments

@kpomeroy1979
Copy link

kpomeroy1979 commented Jan 6, 2022

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
    
@realspookysocks
Copy link

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. $($ ...

@kpomeroy1979
Copy link
Author

Adding the space works perfectly. Thanks :)

bluecurby added a commit to bluecurby/DomainPasswordSpray that referenced this issue Aug 23, 2022
Fixed:
- Domain Parameter was ignored, current domain was always used
- Corrected Issue dafthack#31
- Merged PR dafthack#22
lenhart pushed a commit to lenhart/DomainPasswordSpray that referenced this issue Feb 11, 2024
Fixed:
- Domain Parameter was ignored, current domain was always used
- Corrected Issue dafthack#31
- Merged PR dafthack#22
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants