Author Posts

October 27, 2016 at 11:25 am

How can I run multiple get-vmreplication for multiple clusters?

Get-VM –ComputerName(Get-CusterNode (Get-Content C:\Users\a\Desktop\cluster.txt)) | Where-Object { $_.Name -like '*FS*' } | Get-VMReplication | Select Name, State, Health, PrimaryServer

I want to check the hyper-v replica status of VMs from multiple clusters.
The txt file looks like this:
Pxxclus4
Pxxc1
Lfdcl1

October 27, 2016 at 1:36 pm

Get-Content | 
ForEach-Object {
  # The $_ placeholder will represent one line at a time from the text file
}

Something like that?