Hi guys, I have the following script, if I check the variable $ReplicatingVMs it returns everything within the “VMName” output, but if I run the $FailedVMs variable it only returns one of the machines failing to replicate. Can you see why this would be happening?
As you might have noticed the forum software messed up your code. So please … when you post code, sample data, console output or error messages format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.
Without having experiences with Hyper-V-Replications it looks like you’re overcomplicating this task a lot. What do you actually wnat to achieve? If I got it right you would only need to use Where-Object or Group-Object to get the information you’re looking for.
Regardless of that - could you please share some (sanitized) sample data along with your code (formatted as code as well). So we might be able to reproduce your issue and hopefully fix it.
Sorry I forgot to mention as well, this is a script we’ll be running in our remote management platform to check the status and flag any VM’s which are failing replication at the moment.