remove check if module installed

This commit is contained in:
2025-12-19 16:31:42 -05:00
parent 8c59f5b836
commit 2daec9d287

View File

@@ -1866,30 +1866,6 @@ function Invoke-InstallPrinters {
return return
} }
# Ensure printer install worker exists (from SVSMSP module or your module-integrated functions)
if (-not (Get-Command Invoke-SamyPrinterInstall -ErrorAction SilentlyContinue)) {
Write-LogHybrid "Printer install cmdlets missing. Attempting Install-SVSMSP -InstallToolkit..." Warning Printers -LogToEvent
try {
Install-SVSMSP -InstallToolkit
Import-Module SVSMSP -Force -ErrorAction SilentlyContinue
}
catch {
Write-LogHybrid "Auto-install of SVSMSP failed: $($_.Exception.Message)" Error Printers -LogToEvent
$Context.Response.StatusCode = 500
Send-Text $Context "SVSMSP auto-install failed. Run 'Install SVSMSP Module' manually."
return
}
if (-not (Get-Command Invoke-SamyPrinterInstall -ErrorAction SilentlyContinue)) {
Write-LogHybrid "SVSMSP installed but Invoke-SamyPrinterInstall still unavailable." Error Printers -LogToEvent
$Context.Response.StatusCode = 500
Send-Text $Context "SVSMSP installed but printer install commands still not available. Restart SAMY."
return
}
}
# Read JSON body # Read JSON body
$rawBody = (New-Object IO.StreamReader $Context.Request.InputStream).ReadToEnd() $rawBody = (New-Object IO.StreamReader $Context.Request.InputStream).ReadToEnd()
if (-not $rawBody) { if (-not $rawBody) {