VMware Cloud Community
Bergold
Enthusiast
Enthusiast
Jump to solution

Powercli: New-Folder Type Datastore with location

Hi,

is there any way to create a datastore folder with a location? I can create a folder with the commandlet New-Folder in the root for datastores but not in a subfolder.

0 Kudos
1 Solution

Accepted Solutions
dbalcaraz
Expert
Expert
Jump to solution

I read that this can be a bit tricky but.

If you use Get-Folder and then pipe it to "New-folder" could work.

Something like: Get-Folder -name "test"| New-Folder "test"

Otherwise, check this post I found that it can be helpful: PowerCLI to Generate Nested VM Folder Structure - Notes of a scripter

-------------------------------------------------------- "I greet each challenge with expectation"

View solution in original post

0 Kudos
1 Reply
dbalcaraz
Expert
Expert
Jump to solution

I read that this can be a bit tricky but.

If you use Get-Folder and then pipe it to "New-folder" could work.

Something like: Get-Folder -name "test"| New-Folder "test"

Otherwise, check this post I found that it can be helpful: PowerCLI to Generate Nested VM Folder Structure - Notes of a scripter

-------------------------------------------------------- "I greet each challenge with expectation"
0 Kudos