> For the complete documentation index, see [llms.txt](https://www.osdeploy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.osdeploy.com/guide/cmdlets/install-osdeploysoftware/microsoft-hyper-v.md).

# Microsoft Hyper-V

Enable the Microsoft Hyper-V optional feature and identify whether Windows must restart.

Use the exact name `hyperv` to enable the `Microsoft-Hyper-V-All` Windows optional feature and its parent features. Hyper-V is optional and supports local virtual-machine testing of OSDeploy media and deployment workflows.

## Requirements

Run the command on a physical workstation from an elevated PowerShell 7.6 or later MSI installation on Windows 11 25H2 build 26200 or later.

The parent command requires the current OSDeploy module and `curl.exe`, even though enabling Hyper-V does not download an installer. Windows must provide `Get-WindowsOptionalFeature` and `Enable-WindowsOptionalFeature`.

## Preview

Return the feature name, documentation links, and install command without inspecting or enabling the feature:

```powershell
Install-OSDeploySoftware -Name 'hyperv'
```

## Install

Enable Hyper-V when its state is not already `Enabled` or `EnablePending`:

```powershell
Install-OSDeploySoftware -Name 'hyperv' -Force
```

The helper runs `Enable-WindowsOptionalFeature` with `-All` and `-NoRestart`, then reads the feature state again. It does not restart Windows automatically.

{% hint style="warning" %}
When the parent command detects a virtual machine, it skips the Hyper-V helper and returns `Status` set to `NotSupported`. Nested Hyper-V installation is not attempted.
{% endhint %}

## Download Only

Hyper-V is a Windows feature and has no separate installer to download:

```powershell
Install-OSDeploySoftware -Name 'hyperv' -DownloadOnly
```

On a physical workstation, this returns `Action` set to `DownloadOnly`, `Status` set to `NotSupported`, and a note.

## WhatIf and Result

Use `-Force -WhatIf` to report the enable action without invoking the Hyper-V helper.

A completed action returns `Component` set to `Hyper-V`, `Status` set to `Installed`, and `RestartNeeded`. `Status` does not distinguish newly enabled Hyper-V from a feature that was already enabled. Restart Windows when `RestartNeeded` is `True`.

Inside a virtual machine, the skip result contains `Name`, `Component`, `Action`, `Status`, and `Note` instead.

## Verify

Confirm the feature state after any required restart:

```powershell
Get-WindowsOptionalFeature -Online -FeatureName 'Microsoft-Hyper-V-All'
```

## Next Step

After Hyper-V is operational, use [New-OSDeployHyperVM](/guide/cmdlets/new-osdeployhypervm.md) to create an OSDeploy test virtual machine. Review the [Windows 11 requirement](/guide/requirements/windows-11-os.md) when preparing the host.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://www.osdeploy.com/guide/cmdlets/install-osdeploysoftware/microsoft-hyper-v.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
