Demo entry 6782171

Sample Powershell Script

   

Submitted by anonymous on Jan 09, 2019 at 23:26
Language: PowerShell. Code size: 686 Bytes.

$CertNumber = 'f0d64ec4e52dd214591804542099b8741ce3e2be'
$CheckURL = 'https://localhost:9922/vix/viewer/token2'

$Certificate = Get-ChildItem -Path Cert:\LocalMachine\My\$CertNumber
$req = [system.Net.HttpWebRequest]::Create($checkURL)
$req.ClientCertificates.AddRange($Certificate)
$req.Headers.Add("userId", "000")
$req.Headers.Add("appName", "ingestClientAppName")

$req.Timeout=10000
$res = $req.GetResponse()
$ResponseStream = $res.GetResponseStream()
$StreamReader = New-Object System.IO.StreamReader -ArgumentList $ResponseStream
$str = $StreamReader.ReadToEnd()
Write-Host $str

write-host "Press any key to continue..."
[void][System.Console]::ReadKey($true)

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).