This file contains hidden or 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
# ------------------------------------------------------------------------------ # | |
# EXAMPLE: v9 Auth | |
Add-Type -Path "dll_v9\PsrApi.dll" | |
$psrApi = New-Object PsrApi.PsrApi("url/api") | |
$authenticationFlow = $psrApi.AuthenticationManagerV2.StartNewAuthentication("db", "user") | |
$startLoginTask = $authenticationFlow.StartLogin() | |
$startLoginTask.Wait() |
This file contains hidden or 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
Write-Host -ForegroundColor Yellow "This CLI tool does not work with MFA authentication." | |
Write-Host -ForegroundColor Yellow "Please make sure you're using PowerShell 7.4+" | |
Do { | |
$version = Read-Host "Enter the PWS version (8 or 9)" | |
if (!$version -or ($version -ne '8' -and $version -ne '9')) { | |
Write-Error "Please enter a valid API URL." | |
} | |
} while (!$version -or ($version -ne '8' -and $version -ne '9')) |