Invoke-IssueFix
SYNOPSIS
Takes each fix object passed and invoked the scriptblock adding the results to the object.
SYNTAX
Invoke-IssueFix [-Fix] <PSObject> [-Force] [-DefaultParameterValues <Hashtable>] [-WhatIf] [-Confirm]
[<CommonParameters>]
DESCRIPTION
For each issue fix object passed, if the object status is Ready, Scheduled AND ScheduledAfter is in the past, or Force is set invokes the scriptblock. Add the results to the object and sets status to either Complete or Error. The scriptblock is invoked in a child scope.
EXAMPLES
EXAMPLE 1
PS C:\> Read-IssueFix | Invoke-IssueFix | Write-IssueFix
Reads all issuefixes (assuming DatabasePath set by DefaultParameterValue) and passes to them to be invoked. Only those with status Ready or Scheduled with a scheduledAfter date/time in the past are invoked. Writes the resulting issuefi objects back to the database (assuming DatabasePath set by DefaultParameterValue). Remember, if you don’t write it back to the database the status and results are not saved even those the action was taken.
PARAMETERS
-Fix
The issue fix object to invoke, typically passed via pipeline.
Type: PSObject
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
-Force
Invokes all passed fix objects no matter of status. Normally only those with status Ready OR Scheduled and have a ScheduledAfter value in the past are invoked.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-DefaultParameterValues
Due to the child scope, DefaultParameterValues are not inherited. If needed, pass existing or new DefaultParameterValues into the child scope using this parameter.
Type: Hashtable
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
IssueFix
OUTPUTS
IssueFix The fix object(s) passed through the cmdlet
NOTES
The scriptblock in invoked using the InvokeWithContext method. DefaultParameterValues, if provided is passed into the context.