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