Contact Info

Crumbtrail

ActiveXperts.com » Administration » Powershell » Powershell 2.0 » Start-Transaction

Start-Transaction - Powershell 2.0 CmdLet

ActiveXperts Network Monitor ships with integrated Powershell scripts to monitor complex network. The scripts run out of the box
Download the ActiveXperts Network Monitor FREE version now »

Start-Transaction

Short description
Starts a transaction.

Syntax


Description
The Start-Transaction cmdlet starts a transaction, which is a series of commands that are managed as a unit. A tran
saction can be completed ("committed"), or it can be completely undone ("rolled back") so that any data changed by 
the transaction is restored to its original state. Because the commands in a transaction are managed as a unit, eit
her all commands are committed or all commands are rolled back. 

By default, transactions are rolled back automatically if any command in the transaction generates an error, but yo
u can use the RollbackPreference parameter to change this behavior.

The cmdlets used in a transaction must be designed to support transactions. Cmdlets that support transactions have 
a UseTransaction parameter. To perform transactions in a provider, the provider must support transactions. The Wind
ows PowerShell Registry provider in Windows Vista and later versions of Windows supports transactions. You can also
 use the Microsoft.PowerShell.Commands.Management.TransactedString class to include expressions in transactions on 
any version of Windows that supports Windows PowerShell. Other Windows PowerShell providers can also support transa
ctions. 

Only one transaction can be active at a time. If you start a new, independent transaction while a transaction is in
 progress (neither completed nor undone), the new transaction becomes the active transaction, and you must commit o
r roll back the new transaction before making any changes to the original transaction. 

The Start-Transaction cmdlet is one of a set of cmdlets that support the transactions feature in Windows PowerShell
. For more information, see about_Transactions.