$SERVICE = 'spooler'

## Make sure the service isn't disabled
If (! ($(Get-Service -Name 'spooler').StartType -eq "Disabled") ) {

    ## Stop the spooler service
    Control-Service -Stop -Name $SERVICE
    
    ## Delete all print jobs
    LogMsg "Deleting all print jobs from ""${Env:WINDIR}\System32\spool\PRINTERS"""
    Try { Remove-Item "${Env:WINDIR}\System32\spool\PRINTERS\*" -Recurse  }
    Catch { LogErr $_.Exception.Message }
    
    ## Start the spooler service
    Control-Service -Start -Name $SERVICE

}
