Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Create-VDS {
- # Create folder
- $folder = New-Folder -Location Network -Name $($($dvs.Name) + "-DVS")
- # Create VDS
- $vdswitch = New-VDSwitch -Name $folder.Name -NumUplinkPorts 2 -Version 6.0.0 -Location $folder
- # Create Port Groups
- Foreach ($profile in $port_profiles) {
- if (!(($profile.PortProfileName.Split()[-1] -like "*unused*") -or ($profile.PortProfileName.Split()[-1] -like "*uplink*") -or
- ($profile.PortProfileName.Split()[-1] -like "*n1k*"))) {
- Write-Host "Creating Port Group $($profile.PortProfileName.split()[-1]) with VLAN $($profile.VLANs.Split()[-1])"
- New-VDPortgroup -VDSwitch $script:vdswitch -Name $($profile.portprofilename.split()[-1]) -VlanId $($profile.VLANs.Split()[-1]) | Out-Null
- }
- }
- return
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement