我有两个集群,cluster1 有 5 个节点,cluster2 有 4 个节点。使用以下脚本,cluster1 输出被截断。如何解决这个问题?
PS C:\WINDOWS\system32> $temp = @()
PS C:\WINDOWS\system32> foreach($i in @('cluster1','cluster2')){
>> $pso = New-Object -TypeName psobject
>> $cluster = Get-Cluster $i | select name
>> $cluster_nodes = Get-ClusterNode -Cluster $cluster.Name | select name
>> $pso | Add-Member -MemberType NoteProperty -Name 'Cluster' -Value $cluster.Name
>> $pso | Add-Member -MemberType NoteProperty -Name 'Cluster_nodes' -Value $cluster_nodes.name
>> $temp += $pso
>> }
输出:
PS C:\WINDOWS\system32> $temp
Cluster Cluster_nodes
------- -------------
cluster1 {node1, node2, node3, node4...}
cluster2 {node1, node2, node3, node4}