Yesterday, we have seen that how can we add a virtual disk to the Hyper-V virtual machine.
When I was writing that blog, I was also thinking about to write a article on that how can we add a ISO file to the DVD drive of the Virtual machine.
It's cool to know if you able to directly mount as ISO file to the virtual machine by using our lovely blue coloured PowerShell console.
You want to know how to do that? YES ? Great. let's started.
In the Below screenshot you can see that, currently there is no "CD / DVD Disk" mounted on the DVD Drive of my Virtual Machine "Windows 2008 R2".
I am hoping that by now, you already know how to get the list of all virtual machines.,
We can use the "Get-VM" cmdlet for that, and you can see that "Windows 2008 R2" virtual machine is up and running.
In the below screen shot, you can see a list of my all ISO files located in F:\ISO_Image folder.
I am choosing the "Windows2008R2_all_edition.ISO" file to mount to the my "Windows 2008 R2" virtual machine's DVD Drive.
We use the Set-VMDvdDrive cmdlet to mount the ISO file to the DVD drive of the virtual machines.
Set-VMDvdDrive -VMName 'Windows 2008 R2' -Path
"F:\ISO_Image\Win2008R2_all_editions.iso"
In the above command, we are using Set-VMDvdDrivecmdlet , -VMName parameter we are providing the name of the virtual machine on which we want to mount the ISO file, and in -Path parameters we are providing the path of the ISO file which we want to mount.
In the below screenshot, you can see that command has been completed successfully.
and if you check the virtual machine, you can see that our ISO is mounted successfully.
Come-on.. Believe me
That's all for today. See you in my next blog post. Keep Smiling.
Thanks.
Aman DhallyIf you like, you can follow me on Twitter and Facebook. You can also check my “You Tube” channel for PowerShell video tutorials. You can download all of my scripts from “Microsoft TechNet Gallery”.