Guest User

Untitled

a guest
Dec 10th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. function Get-BasicAuthCredentials {
  2. param (
  3. $user = "admin",
  4. $password = "changeit"
  5. )
  6. $basicAuthPair = "${user}:${password}"
  7. $encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($basicAuthPair))
  8. $basicAuthValue = "Basic $encodedCreds"
  9.  
  10. return $basicAuthValue
  11. }
Add Comment
Please, Sign In to add comment