I am relatively new to PowerShell and the NetApp toolkit (using 4.0, powershell version is 4), but I am writing a script to completely automate a cluster setup for the clusters in my lab with the various settings that I want to have (only after the cluster is created and all nodes have been joined to the cluster). I am currently having issues using the command "Split-NcNetPortBroadcastDomain" from a script or even in the CLI after having defined a variable.Here is the line as I am using it in my script:
Split-NcNetPortBroadcastDomain : Invalid value specified for "ports" element within "net-port-broadcast-domain-split":
At C:\Tools\clustersetup.ps1:181 char:4
+ Split-NcNetPortBroadcastDomain -Name Default -NewName $NewBroadcastDomain -P ...
+ CategoryInfo : InvalidOperation: (node.local:NcController) [Split-NcNetPortBroadcastDomain], EINVALIDINP
+ FullyQualifiedErrorId : ApiException,DataONTAP.C.PowerShell.SDK.Cmdlets.Net.SplitNcNetPortBroadcastDomain
Outside of the script I tested the command which works just fine without a variable, but as soon as I use a variable, the command fails. I am able to use the following similar commands with the same variables without issues:
I see the man page says the Port parameter should be a String, not a String ... On the CLI a comma seperated string is automatically treated as an array, but not so inside a script. That might be why it's working when executed directly on the CLI but fails inside the script ...