pwd part 2

This commit is contained in:
2025-12-17 19:26:35 -05:00
parent 99bacdd7b4
commit b73aae2d87

View File

@@ -1928,15 +1928,17 @@ function Get-SamyClientListFromServer {
[Parameter(Mandatory)]
[string]$Uri,
[Parameter(Mandatory)]
[string]$Password
[Parameter(Mandatory=$false)]
[AllowEmptyString()]
[string]$Password = ""
)
try {
Write-LogHybrid "Calling client list service at $Uri" Info Printers -LogToEvent
$headers = @{
SAMYPW = $Password
$headers = @{}
if (-not [string]::IsNullOrEmpty($Password)) {
$headers.SAMYPW = $Password
}
$resp = Invoke-RestMethod -Uri $Uri `
@@ -1990,11 +1992,8 @@ function Invoke-GetPrinters {
}
$password = $body.password
if (-not $password) {
$Context.Response.StatusCode = 400
Send-Text $Context 'Password is required.'
return
}
if ($null -eq $password) { $password = "" } # allow blank
$uri = 'https://bananas.svstools.ca/getprinters'
Write-LogHybrid "Fetching printers from $uri" Info Printers -LogToEvent