Created
February 15, 2017 13:52
-
-
Save avitsidis/b9dc982303ecf7490a71edfdd73a0f57 to your computer and use it in GitHub Desktop.
Disable Hyper-V VM PXE Boot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
[Parameter(Mandatory=$true)][string]$VMName, | |
[Parameter(Mandatory=$false)][string]$ComputerName = $env:computerName | |
) | |
#based on http://serverfault.com/questions/619763/can-pxe-boot-of-hyper-v-vms-be-disabled | |
$old_boot_order = Get-VMFirmware -VMName $VMName -ComputerName $ComputerName | Select-Object -ExpandProperty BootOrder | |
$new_boot_order = $old_boot_order | Where-Object { $_.BootType -ne "Network" } | |
Set-VMFirmware -VMName $VMName -ComputerName $ComputerName -BootOrder $new_boot_order |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment