Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrote parrot.ps1 to actually use the parrot.live http server. Renam…
…ed to parrot-dance.ps1.
- Loading branch information
1 parent
605b5e3
commit b217198
Showing
2 changed files
with
31 additions
and
4 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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,31 @@ | |||
<# | |||
.SYNOPSIS | |||
Makes a parrot dance on your shell. | |||
.EXAMPLE | |||
./parrot-dance.ps1 | |||
#> | |||
|
|||
$request = [System.Net.HttpWebRequest]::Create("http://parrot.live"); | |||
$response = $request.GetResponse(); | |||
$receiveStream = $response.GetResponseStream(); | |||
$readStream = [System.IO.StreamReader]::new($receiveStream); | |||
|
|||
[console]::TreatControlCAsInput = $true; | |||
$initialForegroundColor = [Console]::ForegroundColor; | |||
while ($line = $readStream.ReadLine()) { | |||
if ([Console]::KeyAvailable) { | |||
$key = [System.Console]::ReadKey($true) | |||
if (($key.modifiers -band [ConsoleModifiers]"control") -and ($key.key -eq "C")) | |||
{ | |||
break; | |||
} | |||
} | |||
|
|||
[Console]::WriteLine($line); | |||
} | |||
|
|||
$readStream.Close(); | |||
$receiveStream.Close(); | |||
$request.Abort(); | |||
[console]::TreatControlCAsInput = $false; | |||
[Console]::ForegroundColor = $initialForegroundColor; |
This file was deleted.
Oops, something went wrong.