Skip to content

Instantly share code, notes, and snippets.

@marking
marking / Invoke-KMSEncrypt-Example.ps1
Created July 12, 2016 23:23 — forked from Sam-Martin/Invoke-KMSEncrypt-Example.ps1
PowerShell Example for using Invoke-KMSEncrypt and Invoke-KMSDecrypt
# Stolen from http://ctrlf5.net/?p=263 and http://www.dailycoding.com/posts/convert_image_to_base64_string_and_base64_string_to_image.aspx
function ConvertFrom-StringToMemoryStream{
param(
[parameter(Mandatory)]
[string]$InputString
)
$stream = New-Object System.IO.MemoryStream;
$writer = New-Object System.IO.StreamWriter($stream);
$writer.Write($InputString);
@marking
marking / invokeWithCookie.ps1
Created March 14, 2016 20:44 — forked from lawrencegripper/invokeWithCookie.ps1
Invoke-webrequest With Cookie
$downloadToPath = "c:\somewhere\on\disk\file.zip"
$remoteFileLocation = "http://somewhere/on/the/internet"
$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession
$cookie = New-Object System.Net.Cookie
$cookie.Name = "cookieName"
$cookie.Value = "valueOfCookie"