Update samy.ps1
This commit is contained in:
21
samy.ps1
21
samy.ps1
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user