Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function Mount-VMISO fails, iso_path and boot_iso_path aren't mounting #68

Open
bradenwright opened this issue Jul 12, 2018 · 0 comments

Comments

@bradenwright
Copy link

iso_path, boot_iso_path are both not working. I've been able to track it down to PowerShell command that won't run.

https://github.com/test-kitchen/kitchen-hyperv/blob/master/support/hyperv.ps1#L225

Add-VMDvdDrive (Get-VM -Id $Id).Name

Won't run, with the following version of powershell:

PS C:\Users\bwright\code\chef_repo\cookbooks\role_clutchdb> $PSVersionTable.PSVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
5      0      10586  122

For a work around I was able to replace https://github.com/test-kitchen/kitchen-hyperv/blob/master/support/hyperv.ps1#L225 with:

Add-VMDvdDrive -VMName (Get-VM -Id $Id).Name -Path $Path | Set-VMDvdDrive -VMName (Get-VM -Id $Id).Name -Path $Path

And that fixed my issue. I'm more than happy to open a PR with tweaks/changes but haven't used PowerShell much so curious which version work/have issues. I just don't know if I can just make the change or if I'll need to have a conditional based on version of PowerShell or something along those lines.

Further, if the PowerShell commands fail, Kitchen swallows them and continues. Really seems like a situation that should fail hard and throw an error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant