CmdID

CmdID / PowerShell / Cmdlets / Get

Get-Transaction

Gets the current (active) transaction. PowerShell reference

From the PowerShell reference

Opens CmdID with your command, read as PowerShell. It is read in your browser and sent nowhere.

What it does

from the PowerShell reference, CC BY 4.0

Gets the current (active) transaction. The Get-Transaction cmdlet gets an object that represents the current transaction in the session. This cmdlet never returns more than one object, because only one transaction is active at a time. If you start one or more independent transactions (by using the Independent parameter of Start-Transaction), the most recently started transaction is active, and that is the transaction that Get-Transaction returns. When all active transactions have either been rolled back or committed, this cmdlet shows the transaction that was most recently active in the session. This cmdlet is one of a set of cmdlets that support the transactions feature in Windows PowerShell. For more information, see about_Transactions.

Get-Transaction [<CommonParameters>]

Get the current transaction

Start-Transaction Get-TransactionIdentify

Show the properties and methods of the transaction object

Get-Transaction | Get-MemberIdentify

Show the property values of a rolled back transaction

Set-Location HKLM:\software Start-Transaction New-Item MyCompany -UseTransaction Undo-Transaction Get-TransactionIdentify

Show the property values of a committed transaction

Set-Location HKLM:\software Start-Transaction New-Item MyCompany -UseTransaction Complete-Transaction Get-TransactionIdentify

Start a transaction while another is in progress

Set-Location HKLM:\software Start-Transaction New-Item MyCompany -UseTransaction Start-Transaction New-Item MyCompany2 -UseTransaction Get-TransactionIdentify

Start an independent transaction while another is in progress

Set-Location HKLM:\software Start-Transaction Get-TransactionIdentify

Its page in the reference: Get-Transaction.