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
# Create single HttpClient | |
$client = [System.Net.Http.HttpClient]::new() | |
# Perform multiple GETs | |
foreach ($url in $urls) { | |
$clientResult = $client.GetStringAsync($url). | |
GetAwaiter(). | |
GetResult() | |
$clientResult | ConvertFrom-Json | |
} |
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
import okhttp3.*; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import javax.net.ssl.*; | |
import java.net.*; | |
import java.security.cert.CertificateException; | |
/* | |
okhttp version used 3.8.1 |
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
if (-not ("Windows.Native.Kernel32" -as [type])) | |
{ | |
Add-Type -TypeDefinition @" | |
namespace Windows.Native | |
{ | |
using System; | |
using System.ComponentModel; | |
using System.IO; | |
using System.Runtime.InteropServices; | |
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
function Add-EnvPath { | |
param( | |
[Parameter(Mandatory=$true)] | |
[string] $Path, | |
[ValidateSet('Machine', 'User', 'Session')] | |
[string] $Container = 'Session' | |
) | |
if ($Container -ne 'Session') { |