PowerShell oneliner to configure Processor Compatibility on VMs in Hyper-V

Sometimes you need to configure the processor compatibility on virtual machines when you need to migrate them between servers that have different processor types (note: types, not brands!).
Here’s a simple oneliner that will configure the processor compatibility on all VM’s:

And to disable it (for whatever reason):

This is something that came up at a workshop I’ve attended this week… very handy!


  1. ShayLevy says:

    Cool, however, you could pipe directly to Set-VMProcessor

    Get-VM | Set-VMProcessor -CompatibilityForMigrationEnabled $true

  2. Jeff Wouters says:

    Whoops… you’re so right….
    Changed the code in the post. Thanks Shay! 🙂

Leave a Reply

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