Last active
November 1, 2017 05:58
-
-
Save bhrgu/49be4e703c256cc584d04e8ecf764289 to your computer and use it in GitHub Desktop.
Basic HTTP auth with Powershell example
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
$username='admin' | |
$password='s3cr3t' | |
$WebResponce = Invoke-WebRequest -Uri "http://192.168.1.1/" ` | |
-Headers @{"Authorization" = "Basic "+[System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($username+":"+$password))} ` | |
-OutFile .\pstest.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment