PowerShell: Get Hyper-V Host Name from Inside Guest VM
$guestVMName="SOMENAME"function getHyperVHostname{ param([string]$guestVMName=$env:computername) $hive = [Microsoft.Win32.RegistryHive]::LocalMachine; $keyPath = 'SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters'; $value = 'HostName'; $reg =…
0 Comments