HI,
we are trying to automate some parts of a build script and we would like to create a folder within the Datastores View to move all the local disk to. the only location I can create a folder has been in the Cluster, DataCenter and VM views. is there a way to accomplish this?
thanks
Matt
That is a hidden folder named "datastore".
You can do
$dsHome = Get-Folder -Name datastore
New-Folder -Name MyFolder -Location $dsHome
Note that there is 1 "datastore" folder per datacenter.
If you have more than 1 datacenter in your vCenter, you will have to indicate which "datastore" folder you want by passing the datacenter.
$dc = Get-Datacenter -Name DC
$dsHome = Get-Folder -Name datastore -Location $dc
New-Folder -Name MyFolder -Location $dsHome
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That is a hidden folder named "datastore".
You can do
$dsHome = Get-Folder -Name datastore
New-Folder -Name MyFolder -Location $dsHome
Note that there is 1 "datastore" folder per datacenter.
If you have more than 1 datacenter in your vCenter, you will have to indicate which "datastore" folder you want by passing the datacenter.
$dc = Get-Datacenter -Name DC
$dsHome = Get-Folder -Name datastore -Location $dc
New-Folder -Name MyFolder -Location $dsHome
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD,
thanks for that, it was exactly what we were looking for.
Matt