Register-HarborHealthSchedule
Registers the Windows Task Scheduler job that runs the health scan on a cadence (G1 pattern): daily at a set time by default, or every N hours. Runs as the CURRENT user without storing a password (S4U), so it fires whether or not anyone is signed in.
Syntax
Section titled “Syntax”Register-HarborHealthSchedule [[-At] <string>] [[-EveryHours] <int>] [[-ConfigProfile] <string>] [[-TaskName] <string>] [-WhatIf] [-Confirm]Description
Section titled “Description”The task invokes the repo’s Invoke-HarborHealthScan.ps1 runner with powershell.exe -NonInteractive (a prompt can never hang it). Each run connects with the profile’s DECLARED service account (its serviceAccount block: Set-HarborServiceAccount, or Harbor Home -> Settings -> Tenant & service account), reading only the declared secret source, as the Windows account the task runs as. So declare a source that account can read with no prompt: ‘dpapi’ stored by that same account, a ‘secretManagement’ vault it can open unattended, or ‘env’ with the variable set in that account’s USER scope (never machine-wide). A ‘prompt’ account cannot run unattended: the task fails fast – check Get-HarborHealthSchedule.LastResult. Re-running replaces the existing task (idempotent).
Examples
Section titled “Examples”Example 1
Section titled “Example 1”Register-HarborHealthSchedule -ConfigProfile prodExample 2
Section titled “Example 2”Register-HarborHealthSchedule -ConfigProfile prod -EveryHours 6Parameters
Section titled “Parameters”Daily run time, 24h ‘HH:mm’ (default 06:00). Ignored when -EveryHours is set.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
String |
No | 0 | No |
Default: 06:00.
-ConfigProfile
Section titled “-ConfigProfile”Not described in the module help.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
String |
No | 2 | No |
-Confirm
Section titled “-Confirm”Asks for confirmation before the command changes anything.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
SwitchParameter |
No | Named | No |
Aliases: cf.
-EveryHours
Section titled “-EveryHours”Run every N hours instead of daily (1-24). First run starts at the next -At time today/tomorrow, then repeats.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
Int32 |
No | 1 | No |
Default: 0.
-TaskName
Section titled “-TaskName”Not described in the module help.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
String |
No | 3 | No |
Default: Harbor Health Scan.
-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 Health cmdlets
- In PowerShell:
Get-Help Register-HarborHealthSchedule -Full
Covers Harbor Onboard 0.59.0 / Harbor Health 0.22.0. On an older release? Upgrading and the release notes list what changed.
