VMware Cloud Community
IMMIAnt
Enthusiast
Enthusiast
Jump to solution

How do you create a "network" folder

Can anyone tell me how to create a network folder.  The New-Folder cmdlet doesn't provide that as an option ,but yet under the vSphere 5.1 Webclient that's an option.

I'm trying to automate the creation of folders, dvSwitches and dvPortGroups.  I can do the rest but can't seem to figure out how to create the network folder which is really the first thing that I want to do.

Any help would be greatly appreciated.

Cheers

Ant

0 Kudos
1 Solution

Accepted Solutions
mattboren
Expert
Expert
Jump to solution

Hello, -

You can use the -Location parameter to New-Folder.  To create a network folder in a given datacenter, do something like:

## new network folder in the given datacenter
New-Folder testInNetwk -Location (Get-Datacenter myDC0 | Get-Folder network -NoRecursion)

And, to create a folder right in the root (not in a datacenter), you can do:

## folder at the root of the vC
New-Folder testFolder -Location (Get-Folder -NoRecursion)

That get at what you are after?

View solution in original post

0 Kudos
2 Replies
mattboren
Expert
Expert
Jump to solution

Hello, -

You can use the -Location parameter to New-Folder.  To create a network folder in a given datacenter, do something like:

## new network folder in the given datacenter
New-Folder testInNetwk -Location (Get-Datacenter myDC0 | Get-Folder network -NoRecursion)

And, to create a folder right in the root (not in a datacenter), you can do:

## folder at the root of the vC
New-Folder testFolder -Location (Get-Folder -NoRecursion)

That get at what you are after?

0 Kudos
IMMIAnt
Enthusiast
Enthusiast
Jump to solution

Hi mattboren

That was exactly what I was after.  Thanks for the help, I really appreciate it.

Cheers

Ant

0 Kudos