Posted On September 30, 2020

Hyper-V Set CompatibilityForMigrationEnabled

kimconnect 0 comments
blog.KimConnect.com >> Codes , Virtualization >> Hyper-V Set CompatibilityForMigrationEnabled
$vmName='TESTVM'
function enableCpuCompatibility($vmName){
    $compatibilityForMigration=(Get-VMProcessor $vmName).CompatibilityForMigrationEnabled
    if(!$compatibilityForMigration){    
        $vmIsRunning=(get-vm $vmname).State -eq 'Running'
        if($vmIsRunning){stop-vm $vmName}
        Set-VMProcessor$vmName -CompatibilityForMigrationEnabled 1
        if($vmIsRunning){start-vm $vmName}
    }else{
        write-host "$vmName already has CPU CompatibilityForMigrationEnabled set to True"
    }
}

enableCpuCompatibility $vmName

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

FTP On Upload Email

# Connection details# If your SMTP server does not support SSL, remove the -UseSSL parameter…

PowerShell: Creating Clustered File Shares

# Define Destination Mount Points and UNC Paths $arr=@{} $arr["from"] = @{}; $arr["to"] = @{}…

How To Modify Collectors of Windows Exporter

Update: here's a generalized version of this function that can be applied to other services…
Other project: DragonCoin.com