Waits until the PSFramework log queue has been flushed.
Wait-PSFMessage [[-Timeout] <DateTimeParameter>] [-Terminate] [<CommonParameters>]
Waits until the PSFramework log queue has been flushed. Also supports ending the logging runspace.
This is designed to explicitly handle script termination for tasks that run in custom hosts that do not properly fire runspace termination events, leading to infinitely hanging tasks.
Waits until all pending messages are logged.
Wait-PSFMessage -Timeout 1m -Terminate
Waits up to one minute for all messages to be flushed, then terminates the logging runspace
Maximum duration for the command to wait until it terminates even if there are messages left.
Type: DateTimeParameter Parameter Sets: (All) Aliases: Required: False Position: 1 Default value: 5m Accept pipeline input: False Accept wildcard characters: False
If this parameter is specified it will terminate the running logging runspace. Use this if your script will run in a powershell host that does not properly execute termination events. Danger!!!! Should never be used in a script that might be called by other scripts, as this might prematurely end logging!
Type: SwitchParameter Parameter Sets: (All) Aliases: Required: False Position: Named Default value: False Accept pipeline input: False Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.