chicagovm
Enthusiast
Enthusiast

Your command only creates a folder under an already created "blue folder". It does not create a new folder directly under the Datacenter when the you are in view - VMs and Templates.

Example > $location = Get-Datacenter -Name CHI | get-folder -Name test

This would mean there is already a folder name "test"

I want to be able to create the folder named "test".

Because as per get-help from new-folder, this will result in creating a “yellow” host and cluster folder. I'm finding online that in order to create a vm folder i have to use method CreateFolder(string)

Found this..

(get-view (get-view -ViewType datacenter -Filter @{"name"="myDC"}).VmFolder).CreateFolder("myTopLevelFolder")

Reply
0 Kudos