Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Error fsmoroleHTML #4

Open
Tynecider opened this issue Jul 28, 2021 · 1 comment
Open

Error fsmoroleHTML #4

Tynecider opened this issue Jul 28, 2021 · 1 comment

Comments

@Tynecider
Copy link

Good day chrisdee,
Running your script produces this error:

PS C:\Automation> C:\Test\CD-HealthChecks.ps1 -domainName xxxxx.org.uk -ReportFile
..domain name specified on cmdline
..testing domain xxxxx.org.uk
..testing domain controller (1 of 1) server01.xxxxx.org.uk
Remove-Variable : Cannot find a variable with the name 'fsmoRoleHTML'.
At C:\Automation\DC-HealthChecks.ps1:493 char:13

  •         Remove-Variable fsmoRoleHTML
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (fsmoRoleHTML:String) [Remove-Variable], ItemNotFoundException
    • FullyQualifiedErrorId : VariableNotFound,Microsoft.PowerShell.Commands.RemoveVariableCommand

Running on PS 5.1 Server 2012
please help :)

@mnmonroe
Copy link

For those that are using this script and run in the error, update the fsmoRoleHTML entries on line 490 and 493 by adding a $. So rather than this:
if (Test-Path variable:fsmoRoleHTML)

    {
        Remove-Variable fsmoRoleHTML
    }

You'd have this:
if (Test-Path variable:$fsmoRoleHTML)

    {
        Remove-Variable $fsmoRoleHTML
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants