microsoft / packer-hyperv

Hyperv plugin for Packer.io
Other
82 stars 33 forks source link

packer hyperv-iso refuses to see that I have hyper-v ps commands available #22

Open Matty666 opened 7 years ago

Matty666 commented 7 years ago

It always complains that PS Hyper-V module is not loaded, but it is.

C:\0source\vagrant [master ↑1 +2 ~1 -0 !]> packer build packer.json
hyperv-iso output will be in this color.

Build 'hyperv-iso' errored: Failed creating Hyper-V driver: PS Hyper-V module is not loaded. Make sure Hyper-V feature is on.

==> Some builds didn't complete successfully and had errors:
--> hyperv-iso: Failed creating Hyper-V driver: PS Hyper-V module is not loaded. Make sure Hyper-V feature is on.

==> Builds finished but no artifacts were created.
C:\0source\vagrant [master ↑1 +2 ~1 -0 !]> get-command get-vm

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Cmdlet          Get-VM                                             2.0.0.0    Hyper-V
kentyman23 commented 6 years ago

Try these two commands:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
Add-WindowsFeature RSAT-Hyper-V-Tools -IncludeAllSubFeature

See these sites for more details: