title: Restore managed OS disk snapshot to existing VM
body: <p>Similar to this <a href="https://stackoverflow.com/questions/43329137/attaching-restored-os-disk-to-existing-vm">one</a> but powershell exclusively and with managed disks and an existing VM.</p>
  
  <p>I took a snapshot of a managed OS disk and want to restore it but can't figure out how. I have tried a number of things but now think that you can't detach an OS disk even if the VM is deallocated. No matter how much I pore through the <a href="https://docs.microsoft.com/en-us/powershell/module/azurerm.compute/?view=azurermps-3.8.0#vm_disks" rel="nofollow noreferrer">reference</a>, I can't find anything to help me restore a snapshot to an existing disk. Is this even possible?</p>