[?1h=DEBUG:    2+  >>>> & $env:CAPTURE_SCRIPT

DEBUG:   16+  >>>> $ErrorActionPreference = "Stop"

DEBUG:   17+  >>>> [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

DEBUG:   19+  >>>> $repo = "pingdotgg/t3code"

DEBUG:   20+  >>>> $baseUrl = if ($env:T3CODE_RELEASE_BASE_URL) { $env:T3CODE_RELEASE_BASE_URL.TrimEnd("/") } else { "http://127.0.0.1:38013/$repo/releases/download" }

DEBUG:   20+ $baseUrl = if ( >>>> $env:T3CODE_RELEASE_BASE_URL) { $env:T3CODE_RELEASE_BASE_URL.TrimEnd("/") } else { "http://127.0.0.1:38013/$repo/releases/download" }

DEBUG:   20+ $baseUrl = if ($env:T3CODE_RELEASE_BASE_URL) {  >>>> $env:T3CODE_RELEASE_BASE_URL.TrimEnd("/") } else { "http://127.0.0.1:38013/$repo/releases/download" }

DEBUG:   21+  >>>> $t3Home = if ($env:T3CODE_HOME) { $env:T3CODE_HOME } else { Join-Path $HOME ".t3" }

DEBUG:   21+ $t3Home = if ( >>>> $env:T3CODE_HOME) { $env:T3CODE_HOME } else { Join-Path $HOME ".t3" }

DEBUG:   21+ $t3Home = if ($env:T3CODE_HOME) {  >>>> $env:T3CODE_HOME } else { Join-Path $HOME ".t3" }

DEBUG:   22+  >>>> $binDir = if ($env:T3CODE_INSTALL_BIN_DIR) { $env:T3CODE_INSTALL_BIN_DIR } else { Join-Path $HOME ".local\bin" }

DEBUG:   22+ $binDir = if ( >>>> $env:T3CODE_INSTALL_BIN_DIR) { $env:T3CODE_INSTALL_BIN_DIR } else { Join-Path $HOME ".local\bin" }

DEBUG:   22+ $binDir = if ($env:T3CODE_INSTALL_BIN_DIR) {  >>>> $env:T3CODE_INSTALL_BIN_DIR } else { Join-Path $HOME ".local\bin" }

DEBUG:   24+  >>>> $binDir = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($binDir)

DEBUG:   31+  >>>> $terminal = -not [Console]::IsErrorRedirected -and $env:TERM -ne "dumb"

DEBUG:   32+  >>>> $interactive = $terminal -and $Host.UI.SupportsVirtualTerminal

DEBUG:   33+ if ( >>>> $interactive) {

DEBUG:   35+    >>>> $glyphs = -join [char[]](0x2588, 0x2580, 0x2584, 0x25A0, 0x00B7)

DEBUG:   36+    >>>> $encoding = [Console]::Error.Encoding

DEBUG:   37+    >>>> $interactive = $encoding.GetString($encoding.GetBytes($glyphs)) -eq $glyphs

DEBUG:   39+  >>>> $esc = [char]27

DEBUG:   40+  >>>> $reset = $bold = $muted = $accent = $green = ""

DEBUG:   40+ $reset =  >>>> $bold = $muted = $accent = $green = ""

DEBUG:   40+ $reset = $bold =  >>>> $muted = $accent = $green = ""

DEBUG:   40+ $reset = $bold = $muted =  >>>> $accent = $green = ""

DEBUG:   40+ $reset = $bold = $muted = $accent =  >>>> $green = ""

DEBUG:   41+ if ( >>>> $interactive -and -not $env:NO_COLOR) {

DEBUG:  120+  >>>> [Console]::Error.WriteLine("CAPTURE_DISPATCH terminal=$terminal interactive=$interactive mechanism=H encoding=$([Console]::Error.Encoding.WebName)")

DEBUG:  120+ [Console]::Error.WriteLine("CAPTURE_DISPATCH terminal=$terminal interactive=$interactive mechanism=H encoding=$( >>>> [Console]::Error.Encoding.WebName)")

CAPTURE_DISPATCH terminal=True interactive=True mechanism=H encoding=utf-8
DEBUG:  122+  >>>> Fetch $env:CAPTURE_URL $env:CAPTURE_DEST -progress

DEBUG:   80+ function Fetch([string] $uri, [string] $destination, [switch] $progress)  >>>> {

DEBUG:   81+   if ( >>>> -not $progress -or -not $interactive) {

DEBUG:   86+    >>>> Add-Type -AssemblyName System.Net.Http

DEBUG:   87+    >>>> $client = New-Object System.Net.Http.HttpClient

DEBUG:   88+    >>>> $response = $source = $file = $null

DEBUG:   88+   $response =  >>>> $source = $file = $null

DEBUG:   88+   $response = $source =  >>>> $file = $null

DEBUG:   90+     for ( >>>> $attempt = 1; ; $attempt++) {

DEBUG:   91+       try {  >>>> $response = $client.GetAsync($uri, [System.Net.Http.HttpCompletionOption]::ResponseHeadersRead).GetAwaiter().GetResult() }

DEBUG:   93+       if ( >>>> $response.IsSuccessStatusCode -or -not (Wait-Retry ([int]$response.StatusCode) $attempt)) { break }

DEBUG:   69+ function Wait-Retry([int] $status, [int] $attempt)  >>>> {

DEBUG:   70+   if ( >>>> $attempt -ge 4 -or ($status -ge 400 -and $status -lt 500 -and $status -ne 408 -and $status -ne 429)) { return $false }

DEBUG:   71+    >>>> Start-Sleep -Seconds ([Math]::Pow(2, $attempt - 1))

DEBUG:   72+   return  >>>> $true

DEBUG:   73+  >>>> }

DEBUG:   94+        >>>> $response.Dispose()

DEBUG:   90+     for ($attempt = 1; ;  >>>> $attempt++) {

DEBUG:   91+       try {  >>>> $response = $client.GetAsync($uri, [System.Net.Http.HttpCompletionOption]::ResponseHeadersRead).GetAwaiter().GetResult() }

DEBUG:   93+       if ( >>>> $response.IsSuccessStatusCode -or -not (Wait-Retry ([int]$response.StatusCode) $attempt)) { break }

DEBUG:   93+       if ($response.IsSuccessStatusCode -or -not (Wait-Retry ([int]$response.StatusCode) $attempt)) {  >>>> break }

DEBUG:   96+      >>>> $response.EnsureSuccessStatusCode() | Out-Null

DEBUG:   97+      >>>> $source = $response.Content.ReadAsStreamAsync().GetAwaiter().GetResult()

DEBUG:   98+      >>>> $file = [IO.File]::Create($destination)

DEBUG:   99+      >>>> $buffer = New-Object byte[] 65536

DEBUG:  100+      >>>> $bytes = 0L

DEBUG:  101+      >>>> $clock = [Diagnostics.Stopwatch]::StartNew()

DEBUG:  102+      >>>> Draw-Download 0 $response.Content.Headers.ContentLength

DEBUG:   49+ function Draw-Download([long] $bytes, [long] $total)  >>>> {

DEBUG:   50+   if ( >>>> -not $interactive) { return }

DEBUG:   51+    >>>> $columns = [Console]::WindowWidth

DEBUG:   52+   if ( >>>> $columns -le 0) { $columns = 80 }

DEBUG:   53+   if ( >>>> $total -gt 0 -and $columns -ge 9) {

DEBUG:   54+      >>>> $percent = [Math]::Min(100, [Math]::Floor($bytes * 100.0 / $total))

DEBUG:   55+      >>>> $width = [Math]::Min(32, $columns - 8)

DEBUG:   56+      >>>> $filled = [int][Math]::Floor($percent * $width / 100)

DEBUG:   57+      >>>> $bar = ([string][char]0x25A0) * $filled

DEBUG:   58+      >>>> $rest = ([string][char]0x00B7) * ($width - $filled)

DEBUG:   59+      >>>> $sizes = ("  {0:F1} / {1:F1} MB" -f ($bytes / 1MB), ($total / 1MB))

DEBUG:   60+     if ( >>>> $width + 7 + $sizes.Length -ge $columns) { $sizes = "" }

DEBUG:   61+      >>>> [Console]::Error.Write(("`r$esc[2K  $accent$bar$reset$muted$rest$reset {0,3}%" -f $percent) + "$muted$sizes$reset")


[2K  ································   0%  0.0 / 0.3 MBDEBUG:   66+  >>>> }

DEBUG:  103+     while ( >>>> ($count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  103+     while (( >>>> $count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  104+        >>>> $file.Write($buffer, 0, $count)

DEBUG:  105+        >>>> $bytes += $count

DEBUG:  106+       if ( >>>> $clock.ElapsedMilliseconds -ge 100) {

DEBUG:  103+     while ( >>>> ($count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  103+     while (( >>>> $count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  104+        >>>> $file.Write($buffer, 0, $count)

DEBUG:  105+        >>>> $bytes += $count

DEBUG:  106+       if ( >>>> $clock.ElapsedMilliseconds -ge 100) {

DEBUG:  107+          >>>> Draw-Download $bytes $response.Content.Headers.ContentLength

DEBUG:   49+ function Draw-Download([long] $bytes, [long] $total)  >>>> {

DEBUG:   50+   if ( >>>> -not $interactive) { return }

DEBUG:   51+    >>>> $columns = [Console]::WindowWidth

DEBUG:   52+   if ( >>>> $columns -le 0) { $columns = 80 }

DEBUG:   53+   if ( >>>> $total -gt 0 -and $columns -ge 9) {

DEBUG:   54+      >>>> $percent = [Math]::Min(100, [Math]::Floor($bytes * 100.0 / $total))

DEBUG:   55+      >>>> $width = [Math]::Min(32, $columns - 8)

DEBUG:   56+      >>>> $filled = [int][Math]::Floor($percent * $width / 100)

DEBUG:   57+      >>>> $bar = ([string][char]0x25A0) * $filled

DEBUG:   58+      >>>> $rest = ([string][char]0x00B7) * ($width - $filled)

DEBUG:   59+      >>>> $sizes = ("  {0:F1} / {1:F1} MB" -f ($bytes / 1MB), ($total / 1MB))

DEBUG:   60+     if ( >>>> $width + 7 + $sizes.Length -ge $columns) { $sizes = "" }

DEBUG:   61+      >>>> [Console]::Error.Write(("`r$esc[2K  $accent$bar$reset$muted$rest$reset {0,3}%" -f $percent) + "$muted$sizes$reset")


[2K  ■■■·····························  12%  0.0 / 0.3 MBDEBUG:   66+  >>>> }

DEBUG:  108+          >>>> $clock.Restart()

DEBUG:  103+     while ( >>>> ($count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  103+     while (( >>>> $count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  104+        >>>> $file.Write($buffer, 0, $count)

DEBUG:  105+        >>>> $bytes += $count

DEBUG:  106+       if ( >>>> $clock.ElapsedMilliseconds -ge 100) {

DEBUG:  107+          >>>> Draw-Download $bytes $response.Content.Headers.ContentLength

DEBUG:   49+ function Draw-Download([long] $bytes, [long] $total)  >>>> {

DEBUG:   50+   if ( >>>> -not $interactive) { return }

DEBUG:   51+    >>>> $columns = [Console]::WindowWidth

DEBUG:   52+   if ( >>>> $columns -le 0) { $columns = 80 }

DEBUG:   53+   if ( >>>> $total -gt 0 -and $columns -ge 9) {

DEBUG:   54+      >>>> $percent = [Math]::Min(100, [Math]::Floor($bytes * 100.0 / $total))

DEBUG:   55+      >>>> $width = [Math]::Min(32, $columns - 8)

DEBUG:   56+      >>>> $filled = [int][Math]::Floor($percent * $width / 100)

DEBUG:   57+      >>>> $bar = ([string][char]0x25A0) * $filled

DEBUG:   58+      >>>> $rest = ([string][char]0x00B7) * ($width - $filled)

DEBUG:   59+      >>>> $sizes = ("  {0:F1} / {1:F1} MB" -f ($bytes / 1MB), ($total / 1MB))

DEBUG:   60+     if ( >>>> $width + 7 + $sizes.Length -ge $columns) { $sizes = "" }

DEBUG:   61+      >>>> [Console]::Error.Write(("`r$esc[2K  $accent$bar$reset$muted$rest$reset {0,3}%" -f $percent) + "$muted$sizes$reset")


[2K  ■■■■■···························  18%  0.0 / 0.3 MBDEBUG:   66+  >>>> }

DEBUG:  108+          >>>> $clock.Restart()

DEBUG:  103+     while ( >>>> ($count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  103+     while (( >>>> $count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  104+        >>>> $file.Write($buffer, 0, $count)

DEBUG:  105+        >>>> $bytes += $count

DEBUG:  106+       if ( >>>> $clock.ElapsedMilliseconds -ge 100) {

DEBUG:  107+          >>>> Draw-Download $bytes $response.Content.Headers.ContentLength

DEBUG:   49+ function Draw-Download([long] $bytes, [long] $total)  >>>> {

DEBUG:   50+   if ( >>>> -not $interactive) { return }

DEBUG:   51+    >>>> $columns = [Console]::WindowWidth

DEBUG:   52+   if ( >>>> $columns -le 0) { $columns = 80 }

DEBUG:   53+   if ( >>>> $total -gt 0 -and $columns -ge 9) {

DEBUG:   54+      >>>> $percent = [Math]::Min(100, [Math]::Floor($bytes * 100.0 / $total))

DEBUG:   55+      >>>> $width = [Math]::Min(32, $columns - 8)

DEBUG:   56+      >>>> $filled = [int][Math]::Floor($percent * $width / 100)

DEBUG:   57+      >>>> $bar = ([string][char]0x25A0) * $filled

DEBUG:   58+      >>>> $rest = ([string][char]0x00B7) * ($width - $filled)

DEBUG:   59+      >>>> $sizes = ("  {0:F1} / {1:F1} MB" -f ($bytes / 1MB), ($total / 1MB))

DEBUG:   60+     if ( >>>> $width + 7 + $sizes.Length -ge $columns) { $sizes = "" }

DEBUG:   61+      >>>> [Console]::Error.Write(("`r$esc[2K  $accent$bar$reset$muted$rest$reset {0,3}%" -f $percent) + "$muted$sizes$reset")


[2K  ■■■■■■■■························  25%  0.1 / 0.3 MBDEBUG:   66+  >>>> }

DEBUG:  108+          >>>> $clock.Restart()

DEBUG:  103+     while ( >>>> ($count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  103+     while (( >>>> $count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  104+        >>>> $file.Write($buffer, 0, $count)

DEBUG:  105+        >>>> $bytes += $count

DEBUG:  106+       if ( >>>> $clock.ElapsedMilliseconds -ge 100) {

DEBUG:  107+          >>>> Draw-Download $bytes $response.Content.Headers.ContentLength

DEBUG:   49+ function Draw-Download([long] $bytes, [long] $total)  >>>> {

DEBUG:   50+   if ( >>>> -not $interactive) { return }

DEBUG:   51+    >>>> $columns = [Console]::WindowWidth

DEBUG:   52+   if ( >>>> $columns -le 0) { $columns = 80 }

DEBUG:   53+   if ( >>>> $total -gt 0 -and $columns -ge 9) {

DEBUG:   54+      >>>> $percent = [Math]::Min(100, [Math]::Floor($bytes * 100.0 / $total))

DEBUG:   55+      >>>> $width = [Math]::Min(32, $columns - 8)

DEBUG:   56+      >>>> $filled = [int][Math]::Floor($percent * $width / 100)

DEBUG:   57+      >>>> $bar = ([string][char]0x25A0) * $filled

DEBUG:   58+      >>>> $rest = ([string][char]0x00B7) * ($width - $filled)

DEBUG:   59+      >>>> $sizes = ("  {0:F1} / {1:F1} MB" -f ($bytes / 1MB), ($total / 1MB))

DEBUG:   60+     if ( >>>> $width + 7 + $sizes.Length -ge $columns) { $sizes = "" }

DEBUG:   61+      >>>> [Console]::Error.Write(("`r$esc[2K  $accent$bar$reset$muted$rest$reset {0,3}%" -f $percent) + "$muted$sizes$reset")


[2K  ■■■■■■■■■·······················  31%  0.1 / 0.3 MBDEBUG:   66+  >>>> }

DEBUG:  108+          >>>> $clock.Restart()

DEBUG:  103+     while ( >>>> ($count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  103+     while (( >>>> $count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  104+        >>>> $file.Write($buffer, 0, $count)

DEBUG:  105+        >>>> $bytes += $count

DEBUG:  106+       if ( >>>> $clock.ElapsedMilliseconds -ge 100) {

DEBUG:  107+          >>>> Draw-Download $bytes $response.Content.Headers.ContentLength

DEBUG:   49+ function Draw-Download([long] $bytes, [long] $total)  >>>> {

DEBUG:   50+   if ( >>>> -not $interactive) { return }

DEBUG:   51+    >>>> $columns = [Console]::WindowWidth

DEBUG:   52+   if ( >>>> $columns -le 0) { $columns = 80 }

DEBUG:   53+   if ( >>>> $total -gt 0 -and $columns -ge 9) {

DEBUG:   54+      >>>> $percent = [Math]::Min(100, [Math]::Floor($bytes * 100.0 / $total))

DEBUG:   55+      >>>> $width = [Math]::Min(32, $columns - 8)

DEBUG:   56+      >>>> $filled = [int][Math]::Floor($percent * $width / 100)

DEBUG:   57+      >>>> $bar = ([string][char]0x25A0) * $filled

DEBUG:   58+      >>>> $rest = ([string][char]0x00B7) * ($width - $filled)

DEBUG:   59+      >>>> $sizes = ("  {0:F1} / {1:F1} MB" -f ($bytes / 1MB), ($total / 1MB))

DEBUG:   60+     if ( >>>> $width + 7 + $sizes.Length -ge $columns) { $sizes = "" }

DEBUG:   61+      >>>> [Console]::Error.Write(("`r$esc[2K  $accent$bar$reset$muted$rest$reset {0,3}%" -f $percent) + "$muted$sizes$reset")


[2K  ■■■■■■■■■■■·····················  37%  0.1 / 0.3 MBDEBUG:   66+  >>>> }

DEBUG:  108+          >>>> $clock.Restart()

DEBUG:  103+     while ( >>>> ($count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  103+     while (( >>>> $count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  104+        >>>> $file.Write($buffer, 0, $count)

DEBUG:  105+        >>>> $bytes += $count

DEBUG:  106+       if ( >>>> $clock.ElapsedMilliseconds -ge 100) {

DEBUG:  107+          >>>> Draw-Download $bytes $response.Content.Headers.ContentLength

DEBUG:   49+ function Draw-Download([long] $bytes, [long] $total)  >>>> {

DEBUG:   50+   if ( >>>> -not $interactive) { return }

DEBUG:   51+    >>>> $columns = [Console]::WindowWidth

DEBUG:   52+   if ( >>>> $columns -le 0) { $columns = 80 }

DEBUG:   53+   if ( >>>> $total -gt 0 -and $columns -ge 9) {

DEBUG:   54+      >>>> $percent = [Math]::Min(100, [Math]::Floor($bytes * 100.0 / $total))

DEBUG:   55+      >>>> $width = [Math]::Min(32, $columns - 8)

DEBUG:   56+      >>>> $filled = [int][Math]::Floor($percent * $width / 100)

DEBUG:   57+      >>>> $bar = ([string][char]0x25A0) * $filled

DEBUG:   58+      >>>> $rest = ([string][char]0x00B7) * ($width - $filled)

DEBUG:   59+      >>>> $sizes = ("  {0:F1} / {1:F1} MB" -f ($bytes / 1MB), ($total / 1MB))

DEBUG:   60+     if ( >>>> $width + 7 + $sizes.Length -ge $columns) { $sizes = "" }

DEBUG:   61+      >>>> [Console]::Error.Write(("`r$esc[2K  $accent$bar$reset$muted$rest$reset {0,3}%" -f $percent) + "$muted$sizes$reset")


[2K  ■■■■■■■■■■■■■···················  43%  0.1 / 0.3 MBDEBUG:   66+  >>>> }

DEBUG:  108+          >>>> $clock.Restart()

DEBUG:  103+     while ( >>>> ($count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  103+     while (( >>>> $count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  104+        >>>> $file.Write($buffer, 0, $count)

DEBUG:  105+        >>>> $bytes += $count

DEBUG:  106+       if ( >>>> $clock.ElapsedMilliseconds -ge 100) {

DEBUG:  107+          >>>> Draw-Download $bytes $response.Content.Headers.ContentLength

DEBUG:   49+ function Draw-Download([long] $bytes, [long] $total)  >>>> {

DEBUG:   50+   if ( >>>> -not $interactive) { return }

DEBUG:   51+    >>>> $columns = [Console]::WindowWidth

DEBUG:   52+   if ( >>>> $columns -le 0) { $columns = 80 }

DEBUG:   53+   if ( >>>> $total -gt 0 -and $columns -ge 9) {

DEBUG:   54+      >>>> $percent = [Math]::Min(100, [Math]::Floor($bytes * 100.0 / $total))

DEBUG:   55+      >>>> $width = [Math]::Min(32, $columns - 8)

DEBUG:   56+      >>>> $filled = [int][Math]::Floor($percent * $width / 100)

DEBUG:   57+      >>>> $bar = ([string][char]0x25A0) * $filled

DEBUG:   58+      >>>> $rest = ([string][char]0x00B7) * ($width - $filled)

DEBUG:   59+      >>>> $sizes = ("  {0:F1} / {1:F1} MB" -f ($bytes / 1MB), ($total / 1MB))

DEBUG:   60+     if ( >>>> $width + 7 + $sizes.Length -ge $columns) { $sizes = "" }

DEBUG:   61+      >>>> [Console]::Error.Write(("`r$esc[2K  $accent$bar$reset$muted$rest$reset {0,3}%" -f $percent) + "$muted$sizes$reset")


[2K  ■■■■■■■■■■■■■■■■················  50%  0.1 / 0.3 MBDEBUG:   66+  >>>> }

DEBUG:  108+          >>>> $clock.Restart()

DEBUG:  103+     while ( >>>> ($count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  103+     while (( >>>> $count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  104+        >>>> $file.Write($buffer, 0, $count)

DEBUG:  105+        >>>> $bytes += $count

DEBUG:  106+       if ( >>>> $clock.ElapsedMilliseconds -ge 100) {

DEBUG:  107+          >>>> Draw-Download $bytes $response.Content.Headers.ContentLength

DEBUG:   49+ function Draw-Download([long] $bytes, [long] $total)  >>>> {

DEBUG:   50+   if ( >>>> -not $interactive) { return }

DEBUG:   51+    >>>> $columns = [Console]::WindowWidth

DEBUG:   52+   if ( >>>> $columns -le 0) { $columns = 80 }

DEBUG:   53+   if ( >>>> $total -gt 0 -and $columns -ge 9) {

DEBUG:   54+      >>>> $percent = [Math]::Min(100, [Math]::Floor($bytes * 100.0 / $total))

DEBUG:   55+      >>>> $width = [Math]::Min(32, $columns - 8)

DEBUG:   56+      >>>> $filled = [int][Math]::Floor($percent * $width / 100)

DEBUG:   57+      >>>> $bar = ([string][char]0x25A0) * $filled

DEBUG:   58+      >>>> $rest = ([string][char]0x00B7) * ($width - $filled)

DEBUG:   59+      >>>> $sizes = ("  {0:F1} / {1:F1} MB" -f ($bytes / 1MB), ($total / 1MB))

DEBUG:   60+     if ( >>>> $width + 7 + $sizes.Length -ge $columns) { $sizes = "" }

DEBUG:   61+      >>>> [Console]::Error.Write(("`r$esc[2K  $accent$bar$reset$muted$rest$reset {0,3}%" -f $percent) + "$muted$sizes$reset")


[2K  ■■■■■■■■■■■■■■■■■···············  56%  0.1 / 0.3 MBDEBUG:   66+  >>>> }

DEBUG:  108+          >>>> $clock.Restart()

DEBUG:  103+     while ( >>>> ($count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  103+     while (( >>>> $count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  104+        >>>> $file.Write($buffer, 0, $count)

DEBUG:  105+        >>>> $bytes += $count

DEBUG:  106+       if ( >>>> $clock.ElapsedMilliseconds -ge 100) {

DEBUG:  107+          >>>> Draw-Download $bytes $response.Content.Headers.ContentLength

DEBUG:   49+ function Draw-Download([long] $bytes, [long] $total)  >>>> {

DEBUG:   50+   if ( >>>> -not $interactive) { return }

DEBUG:   51+    >>>> $columns = [Console]::WindowWidth

DEBUG:   52+   if ( >>>> $columns -le 0) { $columns = 80 }

DEBUG:   53+   if ( >>>> $total -gt 0 -and $columns -ge 9) {

DEBUG:   54+      >>>> $percent = [Math]::Min(100, [Math]::Floor($bytes * 100.0 / $total))

DEBUG:   55+      >>>> $width = [Math]::Min(32, $columns - 8)

DEBUG:   56+      >>>> $filled = [int][Math]::Floor($percent * $width / 100)

DEBUG:   57+      >>>> $bar = ([string][char]0x25A0) * $filled

DEBUG:   58+      >>>> $rest = ([string][char]0x00B7) * ($width - $filled)

DEBUG:   59+      >>>> $sizes = ("  {0:F1} / {1:F1} MB" -f ($bytes / 1MB), ($total / 1MB))

DEBUG:   60+     if ( >>>> $width + 7 + $sizes.Length -ge $columns) { $sizes = "" }

DEBUG:   61+      >>>> [Console]::Error.Write(("`r$esc[2K  $accent$bar$reset$muted$rest$reset {0,3}%" -f $percent) + "$muted$sizes$reset")


[2K  ■■■■■■■■■■■■■■■■■■■·············  62%  0.2 / 0.3 MBDEBUG:   66+  >>>> }

DEBUG:  108+          >>>> $clock.Restart()

DEBUG:  103+     while ( >>>> ($count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  103+     while (( >>>> $count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  104+        >>>> $file.Write($buffer, 0, $count)

DEBUG:  105+        >>>> $bytes += $count

DEBUG:  106+       if ( >>>> $clock.ElapsedMilliseconds -ge 100) {

DEBUG:  107+          >>>> Draw-Download $bytes $response.Content.Headers.ContentLength

DEBUG:   49+ function Draw-Download([long] $bytes, [long] $total)  >>>> {

DEBUG:   50+   if ( >>>> -not $interactive) { return }

DEBUG:   51+    >>>> $columns = [Console]::WindowWidth

DEBUG:   52+   if ( >>>> $columns -le 0) { $columns = 80 }

DEBUG:   53+   if ( >>>> $total -gt 0 -and $columns -ge 9) {

DEBUG:   54+      >>>> $percent = [Math]::Min(100, [Math]::Floor($bytes * 100.0 / $total))

DEBUG:   55+      >>>> $width = [Math]::Min(32, $columns - 8)

DEBUG:   56+      >>>> $filled = [int][Math]::Floor($percent * $width / 100)

DEBUG:   57+      >>>> $bar = ([string][char]0x25A0) * $filled

DEBUG:   58+      >>>> $rest = ([string][char]0x00B7) * ($width - $filled)

DEBUG:   59+      >>>> $sizes = ("  {0:F1} / {1:F1} MB" -f ($bytes / 1MB), ($total / 1MB))

DEBUG:   60+     if ( >>>> $width + 7 + $sizes.Length -ge $columns) { $sizes = "" }

DEBUG:   61+      >>>> [Console]::Error.Write(("`r$esc[2K  $accent$bar$reset$muted$rest$reset {0,3}%" -f $percent) + "$muted$sizes$reset")


[2K  ■■■■■■■■■■■■■■■■■■■■■···········  68%  0.2 / 0.3 MBDEBUG:   66+  >>>> }

DEBUG:  108+          >>>> $clock.Restart()

DEBUG:  103+     while ( >>>> ($count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  103+     while (( >>>> $count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  104+        >>>> $file.Write($buffer, 0, $count)

DEBUG:  105+        >>>> $bytes += $count

DEBUG:  106+       if ( >>>> $clock.ElapsedMilliseconds -ge 100) {

DEBUG:  107+          >>>> Draw-Download $bytes $response.Content.Headers.ContentLength

DEBUG:   49+ function Draw-Download([long] $bytes, [long] $total)  >>>> {

DEBUG:   50+   if ( >>>> -not $interactive) { return }

DEBUG:   51+    >>>> $columns = [Console]::WindowWidth

DEBUG:   52+   if ( >>>> $columns -le 0) { $columns = 80 }

DEBUG:   53+   if ( >>>> $total -gt 0 -and $columns -ge 9) {

DEBUG:   54+      >>>> $percent = [Math]::Min(100, [Math]::Floor($bytes * 100.0 / $total))

DEBUG:   55+      >>>> $width = [Math]::Min(32, $columns - 8)

DEBUG:   56+      >>>> $filled = [int][Math]::Floor($percent * $width / 100)

DEBUG:   57+      >>>> $bar = ([string][char]0x25A0) * $filled

DEBUG:   58+      >>>> $rest = ([string][char]0x00B7) * ($width - $filled)

DEBUG:   59+      >>>> $sizes = ("  {0:F1} / {1:F1} MB" -f ($bytes / 1MB), ($total / 1MB))

DEBUG:   60+     if ( >>>> $width + 7 + $sizes.Length -ge $columns) { $sizes = "" }

DEBUG:   61+      >>>> [Console]::Error.Write(("`r$esc[2K  $accent$bar$reset$muted$rest$reset {0,3}%" -f $percent) + "$muted$sizes$reset")


[2K  ■■■■■■■■■■■■■■■■■■■■■■■■········  75%  0.2 / 0.3 MBDEBUG:   66+  >>>> }

DEBUG:  108+          >>>> $clock.Restart()

DEBUG:  103+     while ( >>>> ($count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  103+     while (( >>>> $count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  104+        >>>> $file.Write($buffer, 0, $count)

DEBUG:  105+        >>>> $bytes += $count

DEBUG:  106+       if ( >>>> $clock.ElapsedMilliseconds -ge 100) {

DEBUG:  107+          >>>> Draw-Download $bytes $response.Content.Headers.ContentLength

DEBUG:   49+ function Draw-Download([long] $bytes, [long] $total)  >>>> {

DEBUG:   50+   if ( >>>> -not $interactive) { return }

DEBUG:   51+    >>>> $columns = [Console]::WindowWidth

DEBUG:   52+   if ( >>>> $columns -le 0) { $columns = 80 }

DEBUG:   53+   if ( >>>> $total -gt 0 -and $columns -ge 9) {

DEBUG:   54+      >>>> $percent = [Math]::Min(100, [Math]::Floor($bytes * 100.0 / $total))

DEBUG:   55+      >>>> $width = [Math]::Min(32, $columns - 8)

DEBUG:   56+      >>>> $filled = [int][Math]::Floor($percent * $width / 100)

DEBUG:   57+      >>>> $bar = ([string][char]0x25A0) * $filled

DEBUG:   58+      >>>> $rest = ([string][char]0x00B7) * ($width - $filled)

DEBUG:   59+      >>>> $sizes = ("  {0:F1} / {1:F1} MB" -f ($bytes / 1MB), ($total / 1MB))

DEBUG:   60+     if ( >>>> $width + 7 + $sizes.Length -ge $columns) { $sizes = "" }

DEBUG:   61+      >>>> [Console]::Error.Write(("`r$esc[2K  $accent$bar$reset$muted$rest$reset {0,3}%" -f $percent) + "$muted$sizes$reset")


[2K  ■■■■■■■■■■■■■■■■■■■■■■■■■·······  81%  0.2 / 0.3 MBDEBUG:   66+  >>>> }

DEBUG:  108+          >>>> $clock.Restart()

DEBUG:  103+     while ( >>>> ($count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  103+     while (( >>>> $count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  104+        >>>> $file.Write($buffer, 0, $count)

DEBUG:  105+        >>>> $bytes += $count

DEBUG:  106+       if ( >>>> $clock.ElapsedMilliseconds -ge 100) {

DEBUG:  107+          >>>> Draw-Download $bytes $response.Content.Headers.ContentLength

DEBUG:   49+ function Draw-Download([long] $bytes, [long] $total)  >>>> {

DEBUG:   50+   if ( >>>> -not $interactive) { return }

DEBUG:   51+    >>>> $columns = [Console]::WindowWidth

DEBUG:   52+   if ( >>>> $columns -le 0) { $columns = 80 }

DEBUG:   53+   if ( >>>> $total -gt 0 -and $columns -ge 9) {

DEBUG:   54+      >>>> $percent = [Math]::Min(100, [Math]::Floor($bytes * 100.0 / $total))

DEBUG:   55+      >>>> $width = [Math]::Min(32, $columns - 8)

DEBUG:   56+      >>>> $filled = [int][Math]::Floor($percent * $width / 100)

DEBUG:   57+      >>>> $bar = ([string][char]0x25A0) * $filled

DEBUG:   58+      >>>> $rest = ([string][char]0x00B7) * ($width - $filled)

DEBUG:   59+      >>>> $sizes = ("  {0:F1} / {1:F1} MB" -f ($bytes / 1MB), ($total / 1MB))

DEBUG:   60+     if ( >>>> $width + 7 + $sizes.Length -ge $columns) { $sizes = "" }

DEBUG:   61+      >>>> [Console]::Error.Write(("`r$esc[2K  $accent$bar$reset$muted$rest$reset {0,3}%" -f $percent) + "$muted$sizes$reset")


[2K  ■■■■■■■■■■■■■■■■■■■■■■■■■■■·····  87%  0.2 / 0.3 MBDEBUG:   66+  >>>> }

DEBUG:  108+          >>>> $clock.Restart()

DEBUG:  103+     while ( >>>> ($count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  103+     while (( >>>> $count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  104+        >>>> $file.Write($buffer, 0, $count)

DEBUG:  105+        >>>> $bytes += $count

DEBUG:  106+       if ( >>>> $clock.ElapsedMilliseconds -ge 100) {

DEBUG:  107+          >>>> Draw-Download $bytes $response.Content.Headers.ContentLength

DEBUG:   49+ function Draw-Download([long] $bytes, [long] $total)  >>>> {

DEBUG:   50+   if ( >>>> -not $interactive) { return }

DEBUG:   51+    >>>> $columns = [Console]::WindowWidth

DEBUG:   52+   if ( >>>> $columns -le 0) { $columns = 80 }

DEBUG:   53+   if ( >>>> $total -gt 0 -and $columns -ge 9) {

DEBUG:   54+      >>>> $percent = [Math]::Min(100, [Math]::Floor($bytes * 100.0 / $total))

DEBUG:   55+      >>>> $width = [Math]::Min(32, $columns - 8)

DEBUG:   56+      >>>> $filled = [int][Math]::Floor($percent * $width / 100)

DEBUG:   57+      >>>> $bar = ([string][char]0x25A0) * $filled

DEBUG:   58+      >>>> $rest = ([string][char]0x00B7) * ($width - $filled)

DEBUG:   59+      >>>> $sizes = ("  {0:F1} / {1:F1} MB" -f ($bytes / 1MB), ($total / 1MB))

DEBUG:   60+     if ( >>>> $width + 7 + $sizes.Length -ge $columns) { $sizes = "" }

DEBUG:   61+      >>>> [Console]::Error.Write(("`r$esc[2K  $accent$bar$reset$muted$rest$reset {0,3}%" -f $percent) + "$muted$sizes$reset")


[2K  ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■···  93%  0.2 / 0.3 MBDEBUG:   66+  >>>> }

DEBUG:  108+          >>>> $clock.Restart()

DEBUG:  103+     while ( >>>> ($count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  103+     while (( >>>> $count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  104+        >>>> $file.Write($buffer, 0, $count)

DEBUG:  105+        >>>> $bytes += $count

DEBUG:  106+       if ( >>>> $clock.ElapsedMilliseconds -ge 100) {

DEBUG:  107+          >>>> Draw-Download $bytes $response.Content.Headers.ContentLength

DEBUG:   49+ function Draw-Download([long] $bytes, [long] $total)  >>>> {

DEBUG:   50+   if ( >>>> -not $interactive) { return }

DEBUG:   51+    >>>> $columns = [Console]::WindowWidth

DEBUG:   52+   if ( >>>> $columns -le 0) { $columns = 80 }

DEBUG:   53+   if ( >>>> $total -gt 0 -and $columns -ge 9) {

DEBUG:   54+      >>>> $percent = [Math]::Min(100, [Math]::Floor($bytes * 100.0 / $total))

DEBUG:   55+      >>>> $width = [Math]::Min(32, $columns - 8)

DEBUG:   56+      >>>> $filled = [int][Math]::Floor($percent * $width / 100)

DEBUG:   57+      >>>> $bar = ([string][char]0x25A0) * $filled

DEBUG:   58+      >>>> $rest = ([string][char]0x00B7) * ($width - $filled)

DEBUG:   59+      >>>> $sizes = ("  {0:F1} / {1:F1} MB" -f ($bytes / 1MB), ($total / 1MB))

DEBUG:   60+     if ( >>>> $width + 7 + $sizes.Length -ge $columns) { $sizes = "" }

DEBUG:   61+      >>>> [Console]::Error.Write(("`r$esc[2K  $accent$bar$reset$muted$rest$reset {0,3}%" -f $percent) + "$muted$sizes$reset")


[2K  ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100%  0.3 / 0.3 MBDEBUG:   66+  >>>> }

DEBUG:  108+          >>>> $clock.Restart()

DEBUG:  103+     while ( >>>> ($count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  103+     while (( >>>> $count = $source.Read($buffer, 0, $buffer.Length)) -gt 0) {

DEBUG:  111+      >>>> Draw-Download $bytes $bytes

DEBUG:   49+ function Draw-Download([long] $bytes, [long] $total)  >>>> {

DEBUG:   50+   if ( >>>> -not $interactive) { return }

DEBUG:   51+    >>>> $columns = [Console]::WindowWidth

DEBUG:   52+   if ( >>>> $columns -le 0) { $columns = 80 }

DEBUG:   53+   if ( >>>> $total -gt 0 -and $columns -ge 9) {

DEBUG:   54+      >>>> $percent = [Math]::Min(100, [Math]::Floor($bytes * 100.0 / $total))

DEBUG:   55+      >>>> $width = [Math]::Min(32, $columns - 8)

DEBUG:   56+      >>>> $filled = [int][Math]::Floor($percent * $width / 100)

DEBUG:   57+      >>>> $bar = ([string][char]0x25A0) * $filled

DEBUG:   58+      >>>> $rest = ([string][char]0x00B7) * ($width - $filled)

DEBUG:   59+      >>>> $sizes = ("  {0:F1} / {1:F1} MB" -f ($bytes / 1MB), ($total / 1MB))

DEBUG:   60+     if ( >>>> $width + 7 + $sizes.Length -ge $columns) { $sizes = "" }

DEBUG:   61+      >>>> [Console]::Error.Write(("`r$esc[2K  $accent$bar$reset$muted$rest$reset {0,3}%" -f $percent) + "$muted$sizes$reset")


[2K  ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100%  0.3 / 0.3 MBDEBUG:   66+  >>>> }

DEBUG:  112+      >>>> [Console]::Error.WriteLine()


DEBUG:  114+     if ( >>>> $file) { $file.Dispose() }

DEBUG:  114+     if ($file) {  >>>> $file.Dispose() }

DEBUG:  115+     if ( >>>> $source) { $source.Dispose() }

DEBUG:  115+     if ($source) {  >>>> $source.Dispose() }

DEBUG:  116+     if ( >>>> $response) { $response.Dispose() }

DEBUG:  116+     if ($response) {  >>>> $response.Dispose() }

DEBUG:  117+      >>>> $client.Dispose()

DEBUG:  119+  >>>> }

DEBUG:  123+  >>>> Write-Output "DEST_LENGTH=$((Get-Item $env:CAPTURE_DEST).Length)"

DEBUG:  123+ Write-Output "DEST_LENGTH=$( >>>> (Get-Item $env:CAPTURE_DEST).Length)"

DEST_LENGTH=262640
DEBUG:  124+  >>>> Write-Output "DEST_SHA256=$((Get-FileHash $env:CAPTURE_DEST -Algorithm SHA256).Hash)"

DEBUG:  124+ Write-Output "DEST_SHA256=$( >>>> (Get-FileHash $env:CAPTURE_DEST -Algorithm SHA256).Hash)"

DEST_SHA256=D43B9967918839C5A0C2430F323403E5E95EBC6C2C104CB17350194E6C3BCB8C
DEBUG:  125+  >>>> Write-Output "CAPTURE_SUCCESS"

CAPTURE_SUCCESS
DEBUG:  132+ } finally {  >>>> [Console]::Error.WriteLine("CAPTURE_CALLER_FINALLY") }

CAPTURE_CALLER_FINALLY
