Created
May 28, 2019 03:45
-
-
Save ay65535/4b8ed8227eb99e1361d8bfd311580b8e to your computer and use it in GitHub Desktop.
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
[CmdletBinding()] | |
param ( | |
[int] $TagSize = 30, | |
[int] $NumOfTags = 32 | |
) | |
$ErrorActionPreference = 'Stop' | |
Set-StrictMode -Version Latest | |
Write-Verbose "`$PSBoundParameters['Debug']: $($PSBoundParameters['Debug'])" | |
Write-Verbose "`$DebugPreference: $DebugPreference" | |
If (($PSBoundParameters['Debug']) -and ($DebugPreference -eq 'Inquire')) { | |
$DebugPreference = 'Continue' | |
} | |
[int] $numOfinoutTags = $NumOfTags / 2 | |
Write-Verbose "`$numOfinoutTags: $numOfinoutTags" | |
Write-Output 'urn:network-tag-v1' | |
for ($i = 1; $i -le $numOfinoutTags; $i++) { | |
$literalI = $i.ToString().PadLeft(3, '0') | |
Write-Debug "`$i: $i" | |
Write-Debug "`$literalI: $literalI" | |
Write-Output "0,L_Out${TagSize}_$literalI,$TagSize,0,,1" | |
} | |
for ($i = 1; $i -le $numOfinoutTags; $i++) { | |
$literalI = $i.ToString().PadLeft(3, '0') | |
Write-Output "1,L_In${TagSize}_$literalI,$TagSize,0,,1" | |
} | |
Write-Output 'urn:network-tagset-v1' | |
for ($i = 1; $i -le $numOfinoutTags; $i++) { | |
$literalI = $i.ToString().PadLeft(3, '0') | |
Write-Output "0,L_Out${TagSize}_$literalI,0,L_Out${TagSize}_$literalI" | |
} | |
for ($i = 1; $i -le $numOfinoutTags; $i++) { | |
$literalI = $i.ToString().PadLeft(3, '0') | |
Write-Output "1,L_In${TagSize}_$literalI,0,L_In${TagSize}_$literalI" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment