我正在使用PowerShell脚本创建集群
New-Cluster -Name $Clustername -Node $Hostname -StaticAddress $ClusterIP
但当它执行命令时,它会给出以下错误
新建群集:无法将"192.168.155.196"转换为参数"StaticAddress"所需的类型"System.Collections.Specialized.StringCollection"。无法将"System.Net.IPAddress"类型的对象强制转换为"System.String"类型的
错误显示$ClusterIP
是[System.Net.IPAddress]
对象。使用其ToString()
方法:
New-Cluster -Name $Clustername -Node $Hostname -StaticAddress $ClusterIP.ToString()