< Back

Wait-NsxGenericJob

Sat Jan 18, 2020 9:30 pm

NAME Wait-NsxGenericJob



SYNOPSIS

Wait for the specified job until it succeeds or fails.





SYNTAX

Wait-NsxGenericJob [-JobId] <String> [[-WaitTimeout] <Int32>] [-FailOnTimeout] [[-Connection] <PSObject>]

[<CommonParameters>]





DESCRIPTION

Generic task framework handler. Wait-NsxGenericJob attempts waits for the

specified job to succeed or fail.



Wait-NsxGenericJob defaults to timeout at 30 seconds, when the user

is prompted to continuing waiting or fail. If immediate failure upon

timeout is desirable (eg within script), then the $failOnTimeout switch can

be set.





PARAMETERS

-JobId <String>

Job Id string as returned from the api



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-WaitTimeout <Int32>

Seconds to wait before declaring a timeout. Timeout defaults to 30 seconds.



Required? false

Position? 2

Default value 30

Accept pipeline input? false

Accept wildcard characters? false



-FailOnTimeout [<SwitchParameter>]

Do we prompt user an allow them to reset the timeout timer, or throw on timeout



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Connection <PSObject>

PowerNSX Connection object



Required? false

Position? 3

Default value $defaultNSXConnection

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Wait-NsxGenericJob -Jobid jobdata-1234



Wait for job jobdata-1234 up to 30 seconds to complete

successfully or fail. If 30 seconds elapse, then prompt for action.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Wait-NsxGenericJob -Jobid jobdata-1234 -TimeOut 40 -FailOnTimeOut



Wait for controller job jobdata-1234 up to 40 seconds to complete

successfully or fail. If 40 seconds elapse, then throw an error.











RELATED LINKS