Skip to content

Instantly share code, notes, and snippets.

@ahmadalli
Created July 1, 2016 10:49
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 ahmadalli/84d01f35b492ea881bb424d174308266 to your computer and use it in GitHub Desktop.
Save ahmadalli/84d01f35b492ea881bb424d174308266 to your computer and use it in GitHub Desktop.
#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