remove check if module installed
This commit is contained in:
24
samy.ps1
24
samy.ps1
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user