Console.ReadLine
or Console.ReadKey
do not work as expected under Docker container environment.
Thus, typical way to solve this would be to properly handle Ctrl-C
key combination.
using System;
using System.Threading;
$script:bg = [Console]::BackgroundColor; | |
$script:first = $true; | |
$script:last = 0; | |
function Write-PromptFancyEnd { | |
Write-Host -NoNewline -ForegroundColor $script:bg | |
$script:bg = [System.ConsoleColor]::Black | |
} |
<# | |
.SYNOPSIS | |
An MTR clone for PowerShell. | |
Written by Tyler Applebaum. | |
Version 2.1 | |
.LINK | |
https://gist.github.com/tylerapplebaum/dc527a3bd875f11871e2 | |
http://www.team-cymru.org/IP-ASN-mapping.html#dns |
// Generated from ZerothAngel's SEScripts version 56430963671f tip | |
// Modules: undocktest, smartundock, gyrocontrol, thrustcontrol, shiporientation, shipcontrol, translateauto, pid, velocimeter, eventdriver, commons | |
// SmartUndock (ship-dependent) | |
const double SMART_UNDOCK_RTB_SPEED = 25.0; // In meters per second | |
const double AUTOPILOT_MIN_SPEED = 1.0; // In meters per second | |
const double AUTOPILOT_TTT_BUFFER = 5.0; // Time-to-target buffer, in seconds | |
const double AUTOPILOT_DISENGAGE_DISTANCE = 5.0; // In meters | |
// SmartUndock |
Function WSUSUpdate { | |
$Criteria = "IsInstalled=0 and Type='Software'" | |
$Searcher = New-Object -ComObject Microsoft.Update.Searcher | |
try { | |
$SearchResult = $Searcher.Search($Criteria).Updates | |
if ($SearchResult.Count -eq 0) { | |
Write-Output "There are no applicable updates." | |
exit | |
} | |
else { |