Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 220008

Re: New-VM Multiple Hard Disks

$
0
0

Hi Luc,

 

Here is some sample output to answer your questions:

 

Write-Host "Populating Disk Array..."

$disks = @(Get-ChildItem ds:\UNIDESK-MCP\UnideskLayers\OS -Recurse -include *.vmdk -Exclude *snapshot*,*-flat.vmdk,*user\* -name)  #ds is a PSDrive at the root of the datastore

 

When I issue the New-Harddisk command, I can connect a single VMDK by using -DiskPath [DataStore] Path/$disks[$x], but I'd like to have a better way of doing this all in one line.  We could have anywhere from 20 to 100 VMDK's that need to be backed up, so I can't use anything static, which makes the script more difficult.  I've been able to break the array down into chunks, so the multiple VM issue should be manageable, it's just the issue of adding multiple paths from the array in one line for simplicity that remains.  (at least for now)

 

Thanks for the help,

 

Mark


Viewing all articles
Browse latest Browse all 220008

Trending Articles