Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Get-BasicAuthCredentials {
- param (
- $user = "admin",
- $password = "changeit"
- )
- $basicAuthPair = "${user}:${password}"
- $encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($basicAuthPair))
- $basicAuthValue = "Basic $encodedCreds"
- return $basicAuthValue
- }
Add Comment
Please, Sign In to add comment