Run and connect to a Hyper V virtual machine without Hyper V manager from the command prompt or with a shortcut using a simple powershell script
Commands:
Get-VM to get the names of the VMs
PS script:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force
start-vm -name “Your VM Name”
vmconnect.exe $Env:computername “Your VM Name”
CMD file:
powershell.exe powershell -Command “Start-Process PowerShell -Verb RunAs” %homedrive%%homepath%\Desktop\your-ps-script.ps1
Shortcut target:
powershell.exe %homedrive%%homepath%\Desktop\your-ps-script.ps1
Shortcut Start in:
%homedrive%%homepath%\Desktop
0 Comments