Set-InsightsCapabilityAction
Sets a remediation action that is tied to a prediction result.
Syntax
Default (Default)
Set-InsightsCapabilityAction
[-Name] <String>
[-Type] <PredictionStatus>
[-Action] <String>
[-ActionCredential] <PSCredential>
[[-ComputerName] <String>]
[-Credential <PSCredential>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Set-InsightsCapabilityAction cmdlet sets a remediation action that is tied to a prediction result.
Important
Some information relates to prereleased product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Examples
Example 1
PS C:\> $Cred = Get-Credential
PS C:\> Set-InsightsCapabilityAction -Name "CPU capacity forecasting" -Type Critical -Action "C:\Users\Public\CriticalAction.ps1" -ActionCredential $Cred
This example sets a Critical action for the CPU capacity forecasting capability, using the credentials specified using the Get-Credential cmdlet.
Example 2
PS C:\> $Cred = Get-Credential
PS C:\> Set-InsightsCapabilityAction -Name "CPU capacity forecasting" -Type Warning -Action "C:\Users\Public\WarningAction.ps1" -ActionCredential $Cred
This example sets a Warning action for the CPU capacity forecasting capability, using the credentials specified using the Get-Credential cmdlet.
Parameters
-Action
Specifies the path of a PowerShell script, as well as any arguments, to be run if the capability outputs the associated prediction status.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | 3 |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-ActionCredential
Specifies the credential used to run the action.
Parameter properties
Type: | PSCredential |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | 4 |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-ComputerName
Specifies a fully qualified domain name (FQDN). If not specified, uses the local computer.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | CN |
Parameter sets
(All)
Position: | 0 |
Mandatory: | False |
Value from pipeline: | True |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | cf |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Credential
Specifies the credential for accessing the computer specified by the -ComputerName parameter.
Parameter properties
Type: | PSCredential |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Name
Specifies a capability using a capability name.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | N |
Parameter sets
(All)
Position: | 1 |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-Type
Specifies the prediction status of the capability. If the capability outputs this status, the action associated with this status will be automatically invoked.
Parameter properties
Type: | PredictionStatus |
Default value: | None |
Accepted values: | None, Ok, Warning, Error, Critical |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | 2 |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | wi |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
Microsoft.SystemInsights.Management.PowerShell.Capability
You can use the pipeline operator to pass a capability object to the Name parameter.