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