PowerTip: Create a Virtual Switch in Hyper-V with Windows PowerShell

The Scripting Guys

Dr Scripto

Summary: Use built-in Hyper-V cmdlets to create virtual switches.

Hey, Scripting Guy! Question How can I use Windows PowerShell in Hyper-V Server 20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/2019/04/2010_scriptgames_badge1.png9/04/hsg_perf3_02.jpg9/04/hsg_perf4_0http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/2019/04/2010_scriptgames_badge1.png9/04/hsg_perf3_02.jpg.jpg9/04/hsg-02-http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/2019/04/2010_scriptgames_badge1.png9/04/hsg_perf3_02.jpg9/04/hsg_perf4_0http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/2019/04/2010_scriptgames_badge1.png9/04/hsg_perf3_02.jpg.jpg7-http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/2019/04/2010_scriptgames_badge1.png9/04/hsg_perf3_02.jpg9/04/hsg_perf4_0http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/20http://devblogs.microsoft.com/scripting/wp-content/uploads/sites/29/2019/04/2010_scriptgames_badge1.png9/04/hsg_perf3_02.jpg.jpg0-03.jpg9/04/questsoftware.png9/04/a-sm.jpg9/04/q-sm.jpg2 R2 to create a virtual switch on a private LAN?

Hey, Scripting Guy! Answer Use the New-VMSwitch cmdlet.
          For example, to create a virtual switch called SuperSecretLan that you can bind virtual machines to, use:

NEW-VMSWITCH –Name ‘SuperSecretLan’ –SwitchType Private

The Scripting Guys
Dr Scripto

Follow Dr Scripto   

No Comments.