The virtualization technology Microsoft Hyper-V can be managed with different tools. Microsoft itself offers numerous options for performing all relevant tasks for managing Hyper-V and controlling VMs.
Managing Hyper-V does not always require complex tools such as System Center Virtual Machine Manager, PowerShell offers numerous possibilities without the need for additional tools.
Of course, the Hyper-V Manager is available as a standard tool, and the new Windows Admin Center also offers numerous functions. In the following, we show 12 interesting tips for controlling Hyper-V with the focus on PowerShell.
These include the PowerShell module and Hyper-V Manager. If the server is to restart automatically, the parameter -restart is added.
Enter-PSSession -VMName
Invoke-Command -VMName -ScriptBlock { Commands }
$PSSession = New-PSSession -VMName -Credential (Get-Credential)
Copy-Item -ToSession $PSSession -Path C:\data.bar -Destination C:\
This allows you to manage the VMs and virtual switches on Hyper-V hosts through your web browser. You can additonaly create and edit virtual servers. You can also control VMs in this way, as well as view the console from your web browser.
New-VMSwitch -name SETswitch -Netadaptername „team1“, „team2“, „team3“ -AllowManagementOS $True -EnableEmbeddedTeaming $true
Get-NetAdapter [[-Name] <string[]>] [-IncludeHidden] [-Physical] [-CimSession <cimsession[]>] [-ThrottleLimit ] [-AsJob] []</cimsession[]></string[]>
Get-VMSwitch [[-Name] ] [[-ResourcePoolName] <string[]>] [-SwitchType <vmswitchtype[]>] [-CimSession <cimsession[]>] [-ComputerName <string[]>] [-Credential <pscredential[]>] []</pscredential[]></string[]></cimsession[]></vmswitchtype[]></string[]>
For more detailed information about the team, use the Get-VMSwitchTeam cmdlet.
To delete such switches, use the Remove-VMSwitch cmdlet.