VMware Cloud Community
MikeR3
Contributor
Contributor
Jump to solution

Creating new VM folder with PowerCLI New-Folder cmdlet as VM folder

Good Afternoon,

As the title implies, this is what I'm trying to do, but when I create the folder it is set to the 'Hosts and Clusters' type.

Is there a way to create or modify it for VM usage? I can't seem to find any reference for doing so in the PowerCLI docs.

 

Thanks.

Labels (1)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You will have to provide the hidden parent folder 'vm' on the location.
If you just provide a Datacenter as Location it will create a folder of type Hosts & Clusters
See the New-Folder cmdlet.

Get-DataCenter -Name MyDC | Get-Folder -Name vm |
New-Folder -Name MyFolder

 


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

2 Replies
LucD
Leadership
Leadership
Jump to solution

You will have to provide the hidden parent folder 'vm' on the location.
If you just provide a Datacenter as Location it will create a folder of type Hosts & Clusters
See the New-Folder cmdlet.

Get-DataCenter -Name MyDC | Get-Folder -Name vm |
New-Folder -Name MyFolder

 


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

MikeR3
Contributor
Contributor
Jump to solution

Worked perfectly, thanks Luc.

0 Kudos