Avatar of chiprule
Flag for Italy asked on

How to query host with powershell

Hi guys,
I want to query my hosts of hyper-v cluster on what type of network adapter they have.
In local host i do this powershell command

Get-NetAdapter -Physical | ft

Open in new window

How can I do a script that query a list of hosts?


Avatar of undefined
Last Comment

8/22/2022 - Mon

Run a Remote Script
To run a script on one or many remote computers, use the FilePath parameter of the Invoke-Command cmdlet. The script must be on or accessible to your local computer. The results are returned to your local computer.

For example, the following command runs the DiskCollect.ps1 script on the Server01 and Server02 remote computers.

Invoke-Command -ComputerName Server01, Server02 -FilePath c:\Scripts\DiskCollect.ps1

Open in new window

For more information about the Invoke-Command cmdlet see:

but if I want to directly launch script that's returns me the result without the invoke command, how can I do?

In few words a script with embedded list of host.


Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy