I have a few Windows Server 2019 Core VMs in Azure all running the same windows service.
I would like to run a powershell script from my computer that loops through all the VMs and restarts the service on each.
I have a PS script on each VM which does this so how do I invoke them remotely? Is this possible without using Cloud Shell or Automation, with just a few lines of code? I have Azure powershell tools installed on my computer too.
Please provide answers with a working example.
Thank you