Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
johnthebrit committed Apr 8, 2022
1 parent ac3c868 commit 912301a
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
7 changes: 7 additions & 0 deletions QuantumLeap/demo.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ping savtestvm.eastasia.cloudapp.azure.com

enable-quantumleap -id /subscriptions/466c1a5d-e93b-4138-91a5-670daf44b0f8/resourceGroups/RG-Quantum/providers/Microsoft.Network/quantumBridge/scus-quantum1

ping savtestvm.eastasia.cloudapp.azure.com

disable-quantumleap
43 changes: 43 additions & 0 deletions QuantumLeap/setup.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
function ping {

param (
$target
)

$ipaddr = '20.187.79.245'

if($QuantumEnabled)
{
$times=1,2,1,1
}
else
{
$times=185,182,187,183
}

Write-Output "`nPinging $($target) [$($ipaddr)] with 32 bytes of data:"
Start-Sleep -Milliseconds 100
$count=0
foreach ($time in $times)
{
Write-Output "Reply from $($ipaddr): bytes=32 time=$($time)ms TTL=128"
$count++
if($count -lt ($times.count))
{
Start-Sleep -Seconds 1
}
}
Start-Sleep -Milliseconds 100
Write-Output "`nPing statistics for $($ipaddr):`n Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),`nApproximate round trip times in milli-seconds:`n Minimum = $([int]($times | measure -Minimum).Minimum)ms, Maximum = $([int]($times | measure -Maximum).Maximum)ms, Average = $([int]($times | measure -Average).Average)ms"
}

function enable-quantumleap {
Set-Variable -Name "QuantumEnabled" -Value $true -Scope global
write-output "Establishing Quantum connection"
Start-Sleep -Seconds 5
write-output "Connection established"
}

function disable-quantumleap {
Set-Variable -Name "QuantumEnabled" -Value $false -Scope global
}

0 comments on commit 912301a

Please sign in to comment.