Using the below power CLI script we can mount an iso image that's there in your windows VM to a VMware VM.
Connect-VIServer -Server <IP> -Protocol https -User <> -Password <pass>
- $Datastore = "datastore1" //datastore on your VC
- Get-Datastore $Datastore | New-DatastoreDrive -Name ds
- New-Item -Type Directory -Path ds:\ISOfiles
- Copy-DatastoreItem -Item "<Path of the ISO file>" -Destination ds:\ISOfiles\0.iso
- Get-VM -Name SCVOVA1 |Get-CDDrive | Set-CDDrive -IsoPath "[$Datastore] ISOfiles\0.iso" -Confirm:$false -Connected $true
Once you are done please remove the PS drive using:
C:\> Remove-PSDrive -Name ds
No comments:
Post a Comment