Cmdlet.TransactionAvailable Method

Determines whether the Start-Transaction cmdlet has been called and that there is a Windows PowerShell transaction available that the cmdlet can participate in. This method is introduced in Windows PowerShell 2.0.


Namespace: System.Management.Automation
Assembly: System.Management.Automation (in System.Management.Automation.dll)

'Usage
Dim instance As Cmdlet
Dim returnValue As Boolean

returnValue = instance.TransactionAvailable

public:
bool TransactionAvailable ()
public boolean TransactionAvailable ()
public function TransactionAvailable () : boolean

Return Value

A Boolean value that indicates true if a transaction is available for the cmdlet to participate in. If the cmdlet supports transactions, it can participate in transactions and the action of the cmdlet can be committed to or rolled back.

Windows PowerShell transactions allow you to perform several actions as a group. If all the actions succeed you can accept the transaction. If any one of the actions fail, you can roll back the transaction.

Transactions are started only when the Start-Transaction cmdlet is run. When started, the Complete-Transaction cmdlet can be run to accept the actions of the cmdlets that participated in the transaction, or the Undo-Transaction cmdlet can be run to roll back the actions made by those cmdlets. Not all cmdlets that are run between when the Start-Transaction cmdlet and the Complete-Transaction cmdlet or the Undo-Transaction cmdlet are called, will participate in the transaction. Only those cmdlets that have their RequiresTx parameter set to true can participate in the transaction.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

 

Target Platforms

Windows Developer Preview, Windows Server Developer Preview

Send comments about this topic to Microsoft.
Show:
© 2014 Microsoft