# install.ps1 $ErrorActionPreference = "Stop" $PrinterPath = "\\EA1196SV\EA - Follow Me" try { # Ensure spooler is running $spooler = Get-Service -Name Spooler -ErrorAction Stop if ($spooler.Status -ne "Running") { Start-Service -Name Spooler } # Add printer connection if missing $existing = Get-Printer -Name $PrinterPath -ErrorAction SilentlyContinue if (-not $existing) { Add-Printer -ConnectionName $PrinterPath } # Set as default printer (try native first, fallback to PrintUI) try { Set-Printer -Name $PrinterPath -IsDefault $true } catch { & rundll32.exe printui.dll,PrintUIEntry /y /n "$PrinterPath" | Out-Null } exit 0 } catch { Write-Error $_ exit 1 }