Created
July 1, 2016 10:49
-
-
Save ahmadalli/84d01f35b492ea881bb424d174308266 to your computer and use it in GitHub Desktop.
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
#fill $ip, $user, $pass with right values | |
$ip = '192.168.1.1' | |
$user = 'user' | |
$pass = 'pass' | |
$pair = "$($user):$($pass)" | |
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair)) | |
$basicAuthValue = "Basic $encodedCreds" | |
$Headers = @{ | |
Authorization = $basicAuthValue | |
} | |
$url = 'http://'+$ip+'/userRpm/SysRebootRpm.htm?Reboot=Reboot' | |
$result = Invoke-WebRequest -Uri $url -Headers $Headers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment