Skip to content

Instantly share code, notes, and snippets.

@ChabaOk
Created April 9, 2017 09:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChabaOk/64007240df02130c93c5200a1160bdeb to your computer and use it in GitHub Desktop.
Save ChabaOk/64007240df02130c93c5200a1160bdeb to your computer and use it in GitHub Desktop.
Simple set spooler service in PowerShell DSC
Configuration ManagePrintServer
{
param (
[string[]]$NodeName = 'localhost'
)
Import-DscResource –ModuleName 'PSDesiredStateConfiguration'
Node $NodeName
{
Service StartSpooler
{
Name = "spooler"
State = "running"
Ensure = "Present"
}
}
}
ManagePrintServer -NodeName localhost -OutputPath C:\mof
Start-DscConfiguration -Path C:\mof -Verbose -wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment