Advertisement
Guest User

Untitled

a guest
Sep 8th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. $hostname = "myhost.now-dns.org"
  2. $user = "user@example.com"
  3. $pass = "password"
  4.  
  5. $url = "https://now-dns.com/update?hostname=${hostname}"
  6.  
  7. $pair = "${user}:${pass}"
  8. $bytes = [System.Text.Encoding]::ASCII.GetBytes($pair)
  9. $base64 = [System.Convert]::ToBase64String($bytes)
  10. $basicAuthValue = "Basic $base64"
  11. $headers = @{ Authorization = $basicAuthValue }
  12.  
  13. Invoke-WebRequest -uri $url -Headers $headers
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement