New-Service

Create a new service, adds an entry in the registry and the service database.

Syntax
New-Service [-name] string [-binaryPathName] string
-displayName string [-description string] [-DependsOn string[]]
[-startupType {Automatic | Manual | Disabled}]
[-credential PSCredential] [-dependsOn string[]]
[-whatIf] [-confirm] [CommonParameters]
Key
-name
A name for the new Service. (required)
-binaryPathName string
The path to the executable file for the service.
-displayName string
The display name for the service.
-description string
A description of the service.
-DependsOn string[]
The names of other services upon which the new service depends.
To enter multiple service names, use a comma to separate the names.
-startupType ServiceStartMode
Will the service start at system bootup: Automatic or Manual or Disabled
-credential PSCredential
Use a credential to validate access to the file. Credential represents
a user-name, such as "User01" or "Domain01\User01", or a PSCredential
object, such as the one retrieved by using the Get-Credential cmdlet.
If you type a user name, you will be prompted for a password.
-dependsOn string[]
A comma-separated list Names of other services upon which
the new service depends.
-whatIf
Describe what would happen if you executed the command without
actually executing the command.
-confirm
Prompt for confirmation before executing the command.
CommonParameters:
-Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable,
-OutBuffer -OutVariable.

Examples

Create a new entry in the registry and in the Service Database for "SS64service":