I created a script to show aggregates more than 90% full on multiple filers but they would not connect
the text file is like this:
"filer1", "filer2", "filer3"
+++++++++++++++++++++++++++++++++++++++++++++++++++
$ntapArrays = (get-content "C:\filers.txt")
$FasUser = "root"
$FasPasswd = Read-Host "Enter password"
$SecureFasPasswd = ConvertTo-SecureString $FasPasswd -AsPlainText -Force
$FasCred = New-Object -TypeName System.Management.Automation.PSCredential ($FasUser, $SecureFasPasswd)
Foreach ($array in $ntapArrays) {
connect-nacontroller -Name $array -Credential $FasCred
Get-Naaggr | select homename, SizePercentageUsed, name | ? {$_.SizePercentageUsed -gt 90} | ft -AutoSize
}
++++++++++++++++++++++++++++++++++++++++++++++
the error messages is
Connect-NaController : Cannot bind argument to parameter 'Name' because it is a
n empty string.
At C:\script2.ps1:30 char:27
+ connect-nacontroller -Name <<<< $array -Credential $FasCred
+ CategoryInfo : InvalidData: (:) [Connect-NaController], Paramet
erBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAl
lowed,DataONTAP.PowerShell.SDK.ConnectNaController
what am I doing wrong?
Cheers