Created
February 8, 2018 06:28
-
-
Save netaviator/25b75176ecce4af790caead29a642a1f to your computer and use it in GitHub Desktop.
Create multiple vlan interfaces and add tagged or untagged interfaces
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
[Parameter(Mandatory=$true)][int]$From, | |
[Parameter(Mandatory=$true)][int]$To, | |
[string]$Description = "", | |
[string]$Tagged = "", | |
[string]$Untagged = "" | |
) | |
if($From -le $To){ | |
for($i = $From; $i -le $To; $i++){ | |
Write-Host "interface vlan" $i | |
if($Description.Length -ne ""){ | |
Write-Host "description" $Description | |
} | |
if($Tagged.Length -ne ""){ | |
Write-Host "tagged" $Tagged | |
} | |
if($Untagged.Length -ne ""){ | |
Write-Host "untagged" $Untagged | |
} | |
Write-Host "exit" | |
} | |
}else{ | |
Write-Warning "To is lower than From!" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment