Skip to content

Commit 9797f89

Browse files
author
PSAppDeployToolkit Action Workflow
committed
Commit of document changes from PSAppDeployToolkit/PSAppDeployToolkit@577c54d
1 parent 61c7fee commit 9797f89

5 files changed

Lines changed: 341 additions & 69 deletions

File tree

docs/reference/functions/Get-ADTServiceStartMode.mdx

Lines changed: 82 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,22 @@ Retrieves the startup mode of a specified service.
1111

1212
## SYNTAX
1313

14+
### Name
15+
16+
```powershell
17+
Get-ADTServiceStartMode -Name <String> [<CommonParameters>]
18+
```
19+
20+
### DisplayName
21+
22+
```powershell
23+
Get-ADTServiceStartMode -DisplayName <String> [<CommonParameters>]
24+
```
25+
26+
### InputObject
27+
1428
```powershell
15-
Get-ADTServiceStartMode [-Service] <ServiceController> [<CommonParameters>]
29+
Get-ADTServiceStartMode -InputObject <ServiceController> [<CommonParameters>]
1630
```
1731

1832
## DESCRIPTION
@@ -25,38 +39,97 @@ This function checks the service's start type and adjusts the result if the serv
2539
### EXAMPLE 1
2640

2741
```powershell
28-
Get-ADTServiceStartMode -Service (Get-Service -Name 'wuauserv')
42+
Get-ADTServiceStartMode -Name 'wuauserv'
43+
```
44+
45+
Retrieves the startup mode of the 'wuauserv' service.
46+
47+
### EXAMPLE 2
48+
49+
```powershell
50+
Get-ADTServiceStartMode -DisplayName 'Windows Update'
51+
```
52+
53+
Retrieves the startup mode of the Windows Update service.
54+
55+
### EXAMPLE 3
56+
57+
```powershell
58+
Get-ADTServiceStartMode -InputObject (Get-Service -Name 'wuauserv')
2959
```
3060

3161
Retrieves the startup mode of the 'wuauserv' service.
3262

63+
### EXAMPLE 4
64+
65+
```powershell
66+
if ((($service = Test-ADTServiceExists -Name 'ScreenConnect*' -PassThru) | Get-ADTServiceStartMode) -ne 'Automatic')
67+
{
68+
Set-ADTServiceStartMode -InputObject $service -StartMode 'Automatic'
69+
}
70+
```
71+
72+
Sets the ScreenConnect service start mode to automatic, if it exists and has its start mode is not automatic.
73+
3374
## PARAMETERS
3475

35-
### -Service
76+
### -Name
3677

37-
Specify the service object to retrieve the startup mode for.
78+
Specifies the service name of the service to retrieve the start mode for.
3879

3980
```yaml
40-
Type: ServiceController
41-
Parameter Sets: (All)
81+
Type: String
82+
Parameter Sets: Name
4283
Aliases:
4384

4485
Required: True
45-
Position: 1
86+
Position: Named
4687
Default value: None
4788
Accept pipeline input: False
4889
Accept wildcard characters: False
4990
```
5091
92+
### -DisplayName
93+
94+
Specifies the display name of the service to retrieve the start mode for.
95+
96+
```yaml
97+
Type: String
98+
Parameter Sets: DisplayName
99+
Aliases:
100+
101+
Required: True
102+
Position: Named
103+
Default value: None
104+
Accept pipeline input: False
105+
Accept wildcard characters: False
106+
```
107+
108+
### -InputObject
109+
110+
Specify the `ServiceController` object to retrieve the start mode for.
111+
112+
```yaml
113+
Type: ServiceController
114+
Parameter Sets: InputObject
115+
Aliases: Service
116+
117+
Required: True
118+
Position: Named
119+
Default value: None
120+
Accept pipeline input: True (ByValue)
121+
Accept wildcard characters: False
122+
```
123+
51124
### CommonParameters
52125

53126
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
54127

55128
## INPUTS
56129

57-
### None
130+
### System.ServiceProcess.ServiceController
58131

59-
### You cannot pipe objects to this function.
132+
### You can pipe `ServiceController` objects to this function.
60133
## OUTPUTS
61134

62135
### System.String

docs/reference/functions/Set-ADTServiceStartMode.mdx

Lines changed: 99 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,24 @@ Set the service startup mode.
1111

1212
## SYNTAX
1313

14+
### Name
15+
16+
```powershell
17+
Set-ADTServiceStartMode -Name <String[]> -StartMode <String> [-PassThru] [-WhatIf] [-Confirm]
18+
[<CommonParameters>]
19+
```
20+
21+
### DisplayName
22+
1423
```powershell
15-
Set-ADTServiceStartMode [-Service] <ServiceController> [-StartMode] <String> [-WhatIf] [-Confirm]
24+
Set-ADTServiceStartMode -DisplayName <String[]> -StartMode <String> [-PassThru] [-WhatIf] [-Confirm]
25+
[<CommonParameters>]
26+
```
27+
28+
### InputObject
29+
30+
```powershell
31+
Set-ADTServiceStartMode -InputObject <ServiceController[]> -StartMode <String> [-PassThru] [-WhatIf] [-Confirm]
1632
[<CommonParameters>]
1733
```
1834

@@ -27,46 +43,115 @@ The startup modes available are: Automatic, Automatic (Delayed Start), Manual, D
2743
### EXAMPLE 1
2844

2945
```powershell
30-
Set-ADTServiceStartMode -Service 'wuauserv' -StartMode 'Automatic (Delayed Start)'
46+
Set-ADTServiceStartMode -Name 'wuauserv' -StartMode 'Automatic (Delayed Start)'
3147
```
3248

3349
Sets the 'wuauserv' service to start automatically with a delayed start.
3450

51+
### EXAMPLE 2
52+
53+
```powershell
54+
Set-ADTServiceStartMode -DisplayName 'Windows Update' -StartMode 'Manual'
55+
```
56+
57+
Sets the Windows Update service to start manually.
58+
59+
### EXAMPLE 3
60+
61+
```powershell
62+
if ((($service = Test-ADTServiceExists -Name 'ScreenConnect*' -PassThru) | Get-ADTServiceStartMode) -ne 'Automatic')
63+
{
64+
Set-ADTServiceStartMode -InputObject $service -StartMode 'Automatic'
65+
}
66+
```
67+
68+
Sets the ScreenConnect service start mode to automatic, if it exists and has its start mode is not automatic.
69+
3570
## PARAMETERS
3671

37-
### -Service
72+
### -Name
3873

39-
Specify the name of the service.
74+
Specifies the service name(s) of the services to set the start mode for.
75+
Wildcards are permitted.
4076

4177
```yaml
42-
Type: ServiceController
43-
Parameter Sets: (All)
78+
Type: String[]
79+
Parameter Sets: Name
80+
Aliases:
81+
82+
Required: True
83+
Position: Named
84+
Default value: None
85+
Accept pipeline input: False
86+
Accept wildcard characters: True
87+
```
88+
89+
### -DisplayName
90+
91+
Specifies the display name(s) of services to set the start mode for.
92+
Wildcards are permitted.
93+
94+
```yaml
95+
Type: String[]
96+
Parameter Sets: DisplayName
4497
Aliases:
4598

4699
Required: True
47-
Position: 1
100+
Position: Named
48101
Default value: None
49102
Accept pipeline input: False
103+
Accept wildcard characters: True
104+
```
105+
106+
### -InputObject
107+
108+
Specifies `ServiceController` object(s) representing the services to be started.
109+
110+
```yaml
111+
Type: ServiceController[]
112+
Parameter Sets: InputObject
113+
Aliases: Service
114+
115+
Required: True
116+
Position: Named
117+
Default value: None
118+
Accept pipeline input: True (ByValue)
50119
Accept wildcard characters: False
51120
```
52121

53122
### -StartMode
54123

55124
Specify startup mode for the service.
56-
Options: Automatic, Automatic (Delayed Start), Manual, Disabled, Boot, System.
125+
Valid values for this parameter are: `Automatic`, `Automatic (Delayed Start)`, `Manual`, `Disabled`, `Boot`, `System`
57126

58127
```yaml
59128
Type: String
60129
Parameter Sets: (All)
61130
Aliases:
62131
63132
Required: True
64-
Position: 2
133+
Position: Named
65134
Default value: None
66135
Accept pipeline input: False
67136
Accept wildcard characters: False
68137
```
69138

139+
### -PassThru
140+
141+
Returns the `ServiceController` service object.
142+
143+
```yaml
144+
Type: SwitchParameter
145+
Parameter Sets: (All)
146+
Aliases:
147+
148+
Required: False
149+
Position: Named
150+
Default value: False
151+
Accept pipeline input: False
152+
Accept wildcard characters: False
153+
```
154+
70155
### -WhatIf
71156

72157
Shows what would happen if the cmdlet runs.
@@ -106,14 +191,16 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
106191

107192
## INPUTS
108193

109-
### None
194+
### System.ServiceProcess.ServiceController
110195

111-
### You cannot pipe objects to this function.
196+
### You can pipe `ServiceController` objects to this function.
112197
## OUTPUTS
113198

114199
### None
115200

116-
### This function does not return any output.
201+
### By default, this function does not return any output.
202+
### System.ServiceProcess.ServiceController
203+
### When the `-PassThru` parameter is provided, this function returns a `ServiceController` object representing the service that was started.
117204
## NOTES
118205
An active ADT session is NOT required to use this function.
119206

0 commit comments

Comments
 (0)