Automation · Windows Automation
Service Automation
Cheat sheet · https://pcornel.dk/topic.php?topic=5670
Answer
Windows Service Automation manages SCM service configuration and lifecycle while distinguishing configuration, service state, process/PID, dependencies, listeners and application readiness.
Remember
- Service command succeeded ≠ service stayed running.
- Running ≠ application ready.
- Startup type correct ≠ current service state correct.
- Restart success ≠ new configuration consumed correctly.
First checks
Get-Service <n> | fl Status,StartType— stateSet-Service <n> -StartupType Automatic— configureRestart-Service <n> -WhatIf— preview
Verify in this order
desired state → Set-Service → verify
Where it usually breaks
Windows service state is bounded evidence and does not alone prove application correctness or external reachability.
Service Automation automation proof-boundary map
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Scope / identity | Exact source revision, hosts and execution identity are explicit | Selector drift, stale inventory or wrong token changes scope/authority |
| Operation | Tool/provider action and per-host result are traceable | Partial failure, hidden error semantics or environment differences are lost |
| Platform state | Persistent and effective state are read back | Command/cmdlet success is mistaken for convergence |
| Workload proof | Original service/application acceptance passes | Automation summary substitutes for actual runtime behavior |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5670