Added quotes around parameters (#20173)
parent
8cc401d36d
commit
90ac05313c
|
@ -153,12 +153,12 @@ Use PowerShell commands to register a service. From an administrative PowerShell
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
$acl = Get-Acl "{EXE PATH}"
|
$acl = Get-Acl "{EXE PATH}"
|
||||||
$aclRuleArgs = {DOMAIN OR COMPUTER NAME\USER}, "Read,Write,ReadAndExecute", "ContainerInherit,ObjectInherit", "None", "Allow"
|
$aclRuleArgs = "{DOMAIN OR COMPUTER NAME\USER}", "Read,Write,ReadAndExecute", "ContainerInherit,ObjectInherit", "None", "Allow"
|
||||||
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule($aclRuleArgs)
|
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule($aclRuleArgs)
|
||||||
$acl.SetAccessRule($accessRule)
|
$acl.SetAccessRule($accessRule)
|
||||||
$acl | Set-Acl "{EXE PATH}"
|
$acl | Set-Acl "{EXE PATH}"
|
||||||
|
|
||||||
New-Service -Name {SERVICE NAME} -BinaryPathName {EXE FILE PATH} -Credential {DOMAIN OR COMPUTER NAME\USER} -Description "{DESCRIPTION}" -DisplayName "{DISPLAY NAME}" -StartupType Automatic
|
New-Service -Name {SERVICE NAME} -BinaryPathName "{EXE FILE PATH}" -Credential "{DOMAIN OR COMPUTER NAME\USER}" -Description "{DESCRIPTION}" -DisplayName "{DISPLAY NAME}" -StartupType Automatic
|
||||||
```
|
```
|
||||||
|
|
||||||
* `{EXE PATH}`: Path to the app's folder on the host (for example, `d:\myservice`). Don't include the app's executable in the path. A trailing slash isn't required.
|
* `{EXE PATH}`: Path to the app's folder on the host (for example, `d:\myservice`). Don't include the app's executable in the path. A trailing slash isn't required.
|
||||||
|
|
Loading…
Reference in New Issue