Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Getting information and piping it to a set command

$
0
0

Hi,

I really don't know PowerShell very well, but what I would like to do is get some information about an object (a particular piece, or two) and then use that information in a set command.

I would like to do the following on Hyper-V 2012

Get-VM (just the name of it), get the MACAddress of the VMNetworkAdapter for that name of VM, then use that MACAddress in a Set-VMNetworkAdapter -StaticMACAddress <string>

all as one command preferably, and even better would be to loop through every single VM in one go and set the MAC address in this manner. how would my command look like if I wanted to grab the MACAddress and something else

Much appreciate your help, thank you

Steve


Viewing all articles
Browse latest Browse all 15028

Trending Articles