This file contains hidden or 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
| #if _CRT_DISABLE | |
| extern "C" int _fltused = 0x9875; | |
| #define WIN32_LEAN_AND_MEAN | |
| #include <stdint.h> | |
| #include <limits.h> | |
| #include <windows.h> | |
| //#include <Windows.h> |
This file contains hidden or 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
| # Use the following commands to bind/unbind SSL cert | |
| # netsh http add sslcert ipport=0.0.0.0:443 certhash=3badca4f8d38a85269085aba598f0a8a51f057ae "appid={00112233-4455-6677-8899-AABBCCDDEEFF}" | |
| # netsh http delete sslcert ipport=0.0.0.0:443 | |
| $HttpListener = New-Object System.Net.HttpListener | |
| $HttpListener.Prefixes.Add("http://+:80/") | |
| $HttpListener.Prefixes.Add("https://+:443/") | |
| $HttpListener.Start() | |
| While ($HttpListener.IsListening) { | |
| $HttpContext = $HttpListener.GetContext() | |
| $HttpRequest = $HttpContext.Request |
This file contains hidden or 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
| while ((Get-BitsTransfer | ? { $_.JobState -eq "Transferring" }).Count -gt 0) { | |
| $totalbytes=0; | |
| $bytestransferred=0; | |
| $timeTaken = 0; | |
| foreach ($job in (Get-BitsTransfer | ? { $_.JobState -eq "Transferring" } | Sort-Object CreationTime)) { | |
| $totalbytes += $job.BytesTotal; | |
| $bytestransferred += $job.bytestransferred | |
| if ($timeTaken -eq 0) { | |
| #Get the time of the oldest transfer aka the one that started first | |
| $timeTaken = ((Get-Date) - $job.CreationTime).TotalMinutes |