- render_uninstall(printer_name, driver_name, port_name): Remove-Printer/Driver/Port in safe order - render_detect(printer_name): Get-Printer check with Write-Output + exit 0/1 Intune contract - uninstall.ps1.j2: all Remove-* with -ErrorAction SilentlyContinue - detect.ps1.j2: Intune detection contract template
9 lines
245 B
Django/Jinja
9 lines
245 B
Django/Jinja
# Generated by ImpTune — Detection script for {{ printer_name }}
|
|
$printer = Get-Printer -Name "{{ printer_name }}" -ErrorAction SilentlyContinue
|
|
if ($printer) {
|
|
Write-Output "Installed: {{ printer_name }}"
|
|
exit 0
|
|
} else {
|
|
exit 1
|
|
}
|