Skip to content

Instantly share code, notes, and snippets.

View luke-z's full-sized avatar
💸
Hustling!

Lukas Zbinden luke-z

💸
Hustling!
View GitHub Profile
@luke-z
luke-z / pws-snippets-1.ps1
Created April 23, 2024 13:25
Password Secure Code Snippets
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'))
@luke-z
luke-z / pws-snippets-2.ps1
Last active September 10, 2024 07:05
Basic filter example
# ------------------------------------------------------------------------------ #
# 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()