Disassembler0 / Win10-Initial-Setup-Script

PowerShell script for automation of routine tasks done after fresh installations of Windows 10 / Server 2016 / Server 2019
MIT License
4.7k stars 1.07k forks source link

Request: Disable/Enable Print Spooler Serivce. #331

Open ghost opened 4 years ago

ghost commented 4 years ago

Made self function dont know this correct way.

Disable Print Spooler

Function DisablePrintSpooler { Write-Output "Stopping and disabling Print Spooler service..." Stop-Service "Spooler" -WarningAction SilentlyContinue Set-Service "Spooler" -StartupType Disabled }

E3V3A commented 4 years ago

Great Idea.

PS. Use triple quotes ```powershell to start code block, and end with another triplet.

Function DisablePrintSpooler {
   Write-Output "Stopping and disabling Print Spooler service..."
   Stop-Service "Spooler" -WarningAction SilentlyContinue
   Set-Service  "Spooler" -StartupType Disabled
}