Skip to content

Commit 6b755c5

Browse files
Clean up comments in Set-WinUtilService.ps1
Removed comments explaining the handling of auto delayed start for PWSH 5.
1 parent 756c4bd commit 6b755c5

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

functions/private/Set-WinUtilService.ps1

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@ Function Set-WinUtilService {
2626

2727
# Service exists, proceed with changing properties -- while handling auto delayed start for PWSH 5
2828
if (($PSVersionTable.PSVersion.Major -lt 7) -and ($StartupType -eq "AutomaticDelayedStart")) {
29-
# Auto delayed start doesn't work with PWSH 5. That startup type is a combination of both the Automatic startup type,
30-
# and an additional DWORD value for delayed start. That's how the SCM defines it. For this, we'll go with sc
31-
#
32-
# PWSH 5 uses a built-in enum for service start types: System.ServiceProcess.ServiceStartMode (https://learn.microsoft.com/en-us/dotnet/api/system.serviceprocess.servicestartmode?view=net-10.0-pp)
33-
# PWSH 7 uses a custom enum for service start types: Microsoft.PowerShell.Commands.ServiceStartupType (https://learn.microsoft.com/en-us/dotnet/api/microsoft.powershell.commands.servicestartuptype?view=powershellsdk-7.4.0)
34-
#
35-
# ---- That's why this doesn't work on the former!
36-
3729
sc.exe config $Name start=delayed-auto
3830
} else {
3931
$service | Set-Service -StartupType $StartupType -ErrorAction Stop

0 commit comments

Comments
 (0)