Update samy.ps1

This commit is contained in:
2025-12-17 19:46:26 -05:00
parent 62ec40cfb0
commit 189aff7ddb

View File

@@ -1,4 +1,4 @@
<#
message$0<#
Last changes made should fix the issues we had wen running thi in Windows 11 25H2
change this line for the message
@@ -1941,11 +1941,17 @@ function Get-SamyClientListFromServer {
$headers.SAMYPW = $Password
}
$resp = Invoke-RestMethod -Uri $Uri `
-Method Get `
-Headers $headers `
-ContentType 'application/json' `
-ErrorAction Stop
$irmParams = @{
Uri = $Uri
Method = 'Get'
ContentType = 'application/json'
ErrorAction = 'Stop'
}
if ($headers.Count -gt 0) { $irmParams.Headers = $headers }
$resp = Invoke-RestMethod @irmParams
if (-not $resp) {
Write-LogHybrid "Client list service returned no data." Warning Printers -LogToEvent
@@ -1991,10 +1997,11 @@ function Invoke-GetPrinters {
return
}
$password = $body.password
$password = ($body.password | ForEach-Object { "$_".Trim() })
if ($null -eq $password) { $password = "" } # allow blank
$uri = 'https://bananas.svstools.ca/getprinters'
Write-LogHybrid "Fetching printers from $uri" Info Printers -LogToEvent