CmdID

CmdID / PowerShell / Cmdlets / Undo

Undo-Transaction

Rolls back the active transaction. PowerShell reference

From the PowerShell reference 2 parameters

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

Rolls back the active transaction. The Undo-Transaction cmdlet rolls back the active transaction. When you roll back a transaction, the changes that were made by the commands in the transaction are discarded and the data is restored to its original form. If the transaction includes multiple subscribers, an Undo-Transaction command rolls back the whole transaction for all subscribers. By default, transactions are rolled back automatically if any command in the transaction generates an error. However, transactions can be started by using a different rollback preference and you can use this cmdlet to roll back the active transaction at any time. The Undo-Transaction cmdlet is one of a set of cmdlets that support the transactions feature in Windows PowerShell. For more information, see about_Transactions.

Undo-Transaction [-WhatIf] [-Confirm] [<CommonParameters>]

Roll back the current transaction

Undo-TransactionIdentify

Start and roll back a transaction

Set-Location HKCU:\software Start-Transaction New-Item -Path "ContosoCompany" -UseTransaction Undo-TransactionIdentify

Roll back a transaction for all subscribers

Set-Location HKCU:\software Start-Transaction New-Item -Path "ContosoCompany" -UseTransaction Get-TransactionIdentify

Its page in the reference: Undo-Transaction.

Parameters

2 in the PowerShell reference
-ConfirmPrompts you for confirmation before running the cmdlet.
-WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.