Open JLogan3o13 opened 5 years ago
Just an update to this, I can successfully create a folder for each vCenter, run the -config parameter and then run each vCheck in sequence, sending a single mail. My preference, of course, would be a single folder with three XML files.
I have just downloaded the latest version. I then went through the -GUIConfig and saved the file off to "vCheckSettingsOK.xml" (as I planned to have a couple different ones). When I attempt to run it, however, like so:
PS D:\Scripts\vmware\vCheck\vCheckOK> .\vCheck.ps1 -job "vCheckSettingsOK.xml" -Outputpath .\Reports
I get an immediate error out of vCheck.ps1:
Test-Path
It appears to enter the If statement on line 741 of vCheck just fine, but the $jobConfig object does not seem to be created. It appears that the if statement that should cause it to default to the GlobalVariables.ps1 is not working, as the next error indicates:
I did confirm that the Global Variables script is in the directory. So I am unsure, first off, why it is not finding the settings XML I have in the same directory. If I, in a separate script, simply do this, it works:
$ScriptPath = (Split-Path ((Get-Variable MyInvocation).Value).MyCommand.Path) Test-Path "$($ScriptPath)\GlobalVariables.ps1"
But does not seem to do so in the vCheck script. Secondly, if it doesn't find the XML file, why is it not defaulting to the GlobalVariables.ps1? I added this to the lines right after the if block, and it comes back blank:
Write-Host "Global Variables Should be $($GlobalVariables)"
Just curious if I am missing something.