Microsoft Virtualization Discussions

Configuration info for a controller

callowaydx
6,652 Views

Full disclosure, I'm fairly new to PowerShell but a big fan. I'm trying to learn more and more so that I can leverage it for my organization.

I'm developing a script that logs into each controller and gathers information that I specify. It takes that informaiton and add/appends it to a file based on the controller name and date/time then attaches those files and sends an email.

The script works up until I check for the multistore license and start checking for different info. Any suggestions? Maybe I need to clean up my script, too. Any and all help would be appreciated.

1 ACCEPTED SOLUTION

bsti
6,652 Views

Here is your issue:

$NFSiSCSIVerify = Get-NaLicense -Name multistore

    if ($NFSViSCSIVerify.Licensed -eq "TRUE")

You have an extra V in your second line. 

Also, I'd avoid comparing a boolean value to a string. It works, but can be confusing.  I'd try something like this:

if ($NFSiSCSIVerify.Licensed )

or

if ($NFSiSCSIVerify.Licensed -eq $true )

View solution in original post

12 REPLIES 12
Public