-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac3c868
commit 912301a
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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 |
This file contains 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
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 | ||
} |