Uninstall-HarborService
Removes the Harbor service task and its http.sys bindings. The deployed files and certificate are kept unless asked for.
Syntax
Section titled “Syntax”Uninstall-HarborService [[-Port] <int>] [[-TaskName] <string>] [[-InstallPath] <string>] [-RemoveCertificate] [-RemoveFiles] [-WhatIf] [-Confirm]Description
Section titled “Description”Run from an elevated console. It stops and unregisters the scheduled task, removes the http.sys url reservation for -Port, and deletes the https certificate bindings of BOTH consoles’ ports (-Port and Harbor Health’s 8788, on 0.0.0.0 and 127.0.0.1) – but only a binding that points at a Harbor certificate; a binding with any other certificate is kept and reported. -RemoveCertificate also removes Harbor’s own certificates: FriendlyName ‘Harbor Web’ (Initialize-HarborTls) or ‘Harbor Onboard Web’ (installs up to 0.57), from LocalMachine\My AND their trust copy in LocalMachine\Root. A certificate is Harbor’s only when it is a server-authentication leaf with that FriendlyName (and, for ‘Harbor Web’, Harbor’s own subject); your own certificate (-CertThumbprint) is never removed, and one still bound on another port is kept. -RemoveFiles deletes the deployed code under %ProgramFiles%\Harbor (never the %ProgramData%\Harbor data store).
Examples
Section titled “Examples”Example 1
Section titled “Example 1”Uninstall-HarborServiceExample 2
Section titled “Example 2”Uninstall-HarborService -RemoveCertificate -RemoveFilesParameters
Section titled “Parameters”-Confirm
Section titled “-Confirm”Asks for confirmation before the command changes anything.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
SwitchParameter |
No | Named | No |
Aliases: cf.
-InstallPath
Section titled “-InstallPath”The CODE root (never the shared data store – -RemoveFiles must not wipe it).
| Type | Required | Position | Pipeline input |
|---|---|---|---|
String |
No | 2 | No |
Default: (Join-Path $env:ProgramFiles 'Harbor').
Not described in the module help.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
Int32 |
No | 0 | No |
Default: 8787.
-RemoveCertificate
Section titled “-RemoveCertificate”Not described in the module help.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
SwitchParameter |
No | Named | No |
-RemoveFiles
Section titled “-RemoveFiles”Not described in the module help.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
SwitchParameter |
No | Named | No |
-TaskName
Section titled “-TaskName”Not described in the module help.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
String |
No | 1 | No |
Default: Harbor Onboard Web.
-WhatIf
Section titled “-WhatIf”Shows what the command would do, without doing it.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
SwitchParameter |
No | Named | No |
Aliases: wi.
This command also accepts the PowerShell common parameters (-Verbose, -ErrorAction, and so on).
See also
Section titled “See also”- All Harbor Onboard cmdlets
- In PowerShell:
Get-Help Uninstall-HarborService -Full
Covers Harbor Onboard 0.59.0 / Harbor Health 0.22.0. On an older release? Upgrading and the release notes list what changed.
