Contact Info

Crumbtrail » Administration » Powershell » Powershell 3.0 » Start-Transaction

Start-Transaction - Powershell 3.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 »


Short description
Starts a transaction.

Start-Transaction [-Independent] [-RollbackPreference <RollbackSeverity>] [-Timeout <Int32>] [-Confirm] [-WhatIf] [<Com

The Start-Transaction cmdlet starts a transaction, which is a series of commands that are managed as a unit. A transact
ion can be completed ("committed"), or it can be completely undone ("rolled back") so that any data changed by the tran
saction is restored to its original state. Because the commands in a transaction are managed as a unit, either all comm
ands 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 you ca
n 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 Us
eTransaction parameter. To perform transactions in a provider, the provider must support transactions. The Windows Powe
rShell Registry provider in Windows Vista and later versions of Windows supports transactions. You can also use the Mic
rosoft.PowerShell.Commands.Management.TransactedString class to include expressions in transactions on any version of W
indows that supports Windows PowerShell. Other Windows PowerShell providers can also support transactions.

Only one transaction can be active at a time. If you start a new, independent transaction while a transaction is in pro
gress (neither completed nor undone), the new transaction becomes the active transaction, and you must commit or roll b
ack 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. Fo
r more information, see about_Transactions.