user1245735
user1245735

Reputation: 43

PowerCLI create a root folder under Datastore Tab

When running: New-Folder -Name myFolder -Location (Get-Folder -NoRecursion)

it creates a root folder under "Hosts and clusters"... How do I create a root folder under the Datastores Tab?

Thank you!

Upvotes: 0

Views: 1250

Answers (1)

Kyle Ruddy
Kyle Ruddy

Reputation: 2121

To do this, you'll need to reference the hidden (from UI) 'datastore' folder object. You can do this with the following code:

New-Folder -Name myFolder -Location (Get-Folder -Name datastore)

Similarly, you can do the same thing when you need to create Host or Network folders.

Upvotes: 1

Related Questions