Skip to content

Commit

Permalink
Fix New-Service -BinaryPathName quotes (MicrosoftDocs#10703)
Browse files Browse the repository at this point in the history
  • Loading branch information
RFCreate authored Dec 3, 2023
1 parent ac5f203 commit 301a0a6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions reference/5.1/Microsoft.PowerShell.Management/New-Service.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies of the service.
### Example 1: Create a service

```powershell
New-Service -Name "TestService" -BinaryPathName '"C:\WINDOWS\System32\svchost.exe -k netsvcs"'
New-Service -Name "TestService" -BinaryPathName 'C:\WINDOWS\System32\svchost.exe -k netsvcs'
```

This command creates a service named TestService.
Expand All @@ -44,7 +44,7 @@ This command creates a service named TestService.
```powershell
$params = @{
Name = "TestService"
BinaryPathName = '"C:\WINDOWS\System32\svchost.exe -k netsvcs"'
BinaryPathName = 'C:\WINDOWS\System32\svchost.exe -k netsvcs'
DependsOn = "NetLogon"
DisplayName = "Test Service"
StartupType = "Manual"
Expand Down Expand Up @@ -97,7 +97,7 @@ so that it is correctly interpreted. For example, `d:\my share\myservice.exe` sh
`'"d:\my share\myservice.exe"'`.

The path can also include arguments for an auto-start service. For example,
`'"d:\myshare\myservice.exe arg1 arg2"'`. These arguments are passed to the service entry point.
`'"d:\my share\myservice.exe" arg1 arg2'`. These arguments are passed to the service entry point.

For more information, see the **lpBinaryPathName** parameter of
[CreateServiceW](/windows/win32/api/winsvc/nf-winsvc-createservicew) API.
Expand Down
8 changes: 4 additions & 4 deletions reference/7.2/Microsoft.PowerShell.Management/New-Service.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies of the service.
### Example 1: Create a service

```powershell
New-Service -Name "TestService" -BinaryPathName '"C:\WINDOWS\System32\svchost.exe -k netsvcs"'
New-Service -Name "TestService" -BinaryPathName 'C:\WINDOWS\System32\svchost.exe -k netsvcs'
```

This command creates a service named TestService.
Expand All @@ -46,7 +46,7 @@ This command creates a service named TestService.
```powershell
$params = @{
Name = "TestService"
BinaryPathName = '"C:\WINDOWS\System32\svchost.exe -k netsvcs"'
BinaryPathName = 'C:\WINDOWS\System32\svchost.exe -k netsvcs'
DependsOn = "NetLogon"
DisplayName = "Test Service"
StartupType = "Manual"
Expand Down Expand Up @@ -83,7 +83,7 @@ This example adds the **SecurityDescriptor** of the service being created.
```powershell
$SDDL = "D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;SU)"
$params = @{
BinaryPathName = '"C:\WINDOWS\System32\svchost.exe -k netsvcs"'
BinaryPathName = 'C:\WINDOWS\System32\svchost.exe -k netsvcs'
DependsOn = "NetLogon"
DisplayName = "Test Service"
StartupType = "Manual"
Expand All @@ -107,7 +107,7 @@ so that it is correctly interpreted. For example, `d:\my share\myservice.exe` sh
`'"d:\my share\myservice.exe"'`.

The path can also include arguments for an auto-start service. For example,
`'"d:\myshare\myservice.exe arg1 arg2"'`. These arguments are passed to the service entry point.
`'"d:\my share\myservice.exe" arg1 arg2'`. These arguments are passed to the service entry point.

For more information, see the **lpBinaryPathName** parameter of
[CreateServiceW](/windows/win32/api/winsvc/nf-winsvc-createservicew) API.
Expand Down
8 changes: 4 additions & 4 deletions reference/7.3/Microsoft.PowerShell.Management/New-Service.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies of the service.
### Example 1: Create a service

```powershell
New-Service -Name "TestService" -BinaryPathName "C:\WINDOWS\System32\svchost.exe -k netsvcs"
New-Service -Name "TestService" -BinaryPathName 'C:\WINDOWS\System32\svchost.exe -k netsvcs'
```

This command creates a service named TestService.
Expand All @@ -46,7 +46,7 @@ This command creates a service named TestService.
```powershell
$params = @{
Name = "TestService"
BinaryPathName = "C:\WINDOWS\System32\svchost.exe -k netsvcs"
BinaryPathName = 'C:\WINDOWS\System32\svchost.exe -k netsvcs'
DependsOn = "NetLogon"
DisplayName = "Test Service"
StartupType = "Manual"
Expand Down Expand Up @@ -83,7 +83,7 @@ This example adds the **SecurityDescriptor** of the service being created.
```powershell
$SDDL = "D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;SU)"
$params = @{
BinaryPathName = "C:\WINDOWS\System32\svchost.exe -k netsvcs"
BinaryPathName = 'C:\WINDOWS\System32\svchost.exe -k netsvcs'
DependsOn = "NetLogon"
DisplayName = "Test Service"
StartupType = "Manual"
Expand All @@ -107,7 +107,7 @@ so that it is correctly interpreted. For example, `d:\my share\myservice.exe` sh
`'"d:\my share\myservice.exe"'`.

The path can also include arguments for an auto-start service. For example,
`'"d:\myshare\myservice.exe arg1 arg2"'`. These arguments are passed to the service entry point.
`'"d:\my share\myservice.exe" arg1 arg2'`. These arguments are passed to the service entry point.

For more information, see the **lpBinaryPathName** parameter of
[CreateServiceW](/windows/win32/api/winsvc/nf-winsvc-createservicew) API.
Expand Down
8 changes: 4 additions & 4 deletions reference/7.4/Microsoft.PowerShell.Management/New-Service.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies of the service.
### Example 1: Create a service

```powershell
New-Service -Name "TestService" -BinaryPathName '"C:\WINDOWS\System32\svchost.exe -k netsvcs"'
New-Service -Name "TestService" -BinaryPathName 'C:\WINDOWS\System32\svchost.exe -k netsvcs'
```

This command creates a service named TestService.
Expand All @@ -46,7 +46,7 @@ This command creates a service named TestService.
```powershell
$params = @{
Name = "TestService"
BinaryPathName = '"C:\WINDOWS\System32\svchost.exe -k netsvcs"'
BinaryPathName = 'C:\WINDOWS\System32\svchost.exe -k netsvcs'
DependsOn = "NetLogon"
DisplayName = "Test Service"
StartupType = "Manual"
Expand Down Expand Up @@ -83,7 +83,7 @@ This example adds the **SecurityDescriptor** of the service being created.
```powershell
$SDDL = "D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;SU)"
$params = @{
BinaryPathName = '"C:\WINDOWS\System32\svchost.exe -k netsvcs"'
BinaryPathName = 'C:\WINDOWS\System32\svchost.exe -k netsvcs'
DependsOn = "NetLogon"
DisplayName = "Test Service"
StartupType = "Manual"
Expand All @@ -107,7 +107,7 @@ so that it is correctly interpreted. For example, `d:\my share\myservice.exe` sh
`'"d:\my share\myservice.exe"'`.

The path can also include arguments for an auto-start service. For example,
`'"d:\myshare\myservice.exe arg1 arg2"'`. These arguments are passed to the service entry point.
`'"d:\my share\myservice.exe" arg1 arg2'`. These arguments are passed to the service entry point.

For more information, see the **lpBinaryPathName** parameter of
[CreateServiceW](/windows/win32/api/winsvc/nf-winsvc-createservicew) API.
Expand Down

0 comments on commit 301a0a6

Please sign in to comment.