For the complete documentation index, see llms.txt. This page is also available as Markdown.

New-PSUHealthCheck

Creates a new health check.

SYNOPSIS

Creates a new health check.

SYNTAX

New-PSUHealthCheck -Name <String> [-Description <String>] [-DisableUnix] [-DisableWindows]
 [-ScriptBlock <ScriptBlock>] [-Disabled] [-Options <Hashtable>] [-ComputerName <String>] [-AppToken <String>]
 [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]

DESCRIPTION

Creates a new health check.

EXAMPLES

Example 1

PS C:\> New-PSUHealthCheck -Name 'Test Health Check' -ScriptBlock {
    $Exists = Test-Path C:\Temp
    New-PSUHealthCheckResult -Message "C:\Temp exists: $Exists"
}

Creates a new health check named 'Test Health Check' that runs the Test-Path cmdlet.

PARAMETERS

-AppToken

The AppToken that is used for calling the PowerShell Universal Management API. You can also call Connect-PSUServer before calling this cmdlet to set the AppToken for the entire session.

-ComputerName

Specifies the computer name or URL that should be called when accessing the PowerShell Universal Management API. You can also use Connect-PSUServer before calling this cmdlet to set the computer name for the entire session.

-Description

A description of the health check.

-DisableUnix

Disables the health check on Unix systems.

-DisableWindows

Disables the health check on Windows systems.

-Disabled

Disables the health check.

-Integrated

Executes the command internally rather than using the Management API. Only works when running script from within PowerShell Universal.

-Name

The name of the health check.

-Options

The options to pass to the health check.

-ScriptBlock

The script block to run when executing the health check.

-UseDefaultCredentials

Use the default credentials for the current user.

-Credential

Credentials to login to the PowerShell Universal Management API.

-TrustCertificate

Whether the cmdlet should ignore certificate issues.

-Cookies

Reuses and persists authentication cookies for the current PowerShell session.

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -Verbose, -WarningAction, -WarningVariable, and -ProgressAction. For more information, see about_CommonParameters.

INPUTS

None

OUTPUTS

System.Object

NOTES

Last updated

Was this helpful?