Skip to content

Instantly share code, notes, and snippets.

@torgro
Last active February 14, 2018 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save torgro/7deefd379a8ae15dc3b09484fdc08176 to your computer and use it in GitHub Desktop.
Save torgro/7deefd379a8ae15dc3b09484fdc08176 to your computer and use it in GitHub Desktop.
Start-UDRestApi -Port 11000 -Endpoint @($CreateFileEndpoint, $GetFileEndpoint)
$securePwd = ConvertTo-SecureString -String bar -AsPlainText -Force
$authKey = [PSCredential]::New("foo", $securePwd) | Get-AuthorizationHeader
$invokeSplat = @{
Uri = "http://localhost:11000/api/file"
Method = 'Get'
Headers = $authKey
}
Invoke-RestMethod @invokeSplat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment