Commit the active transaction. All commands in the transaction are finalized and the data affected by the commands is changed.
Syntax Complete-Transaction [-Confirm] [-WhatIf] [CommonParameters] Key -confirm Prompt for confirmation before executing the command. -whatIf Describe what would happen if you executed the command without actually executing the command.
If the transaction includes multiple subscribers, to commit the transaction, you must enter one Complete-Transaction command for every Start-Transaction command.
Adding a new registry key:
PS C:\> cd hkcu:\software
PS HKCU:\software> Start-Transaction
PS HKCU:\software> New-Item windevcluster -UseTransaction
PS HKCU:\software> Get-ChildItem SS*
^ returns nothing as it is not part of the transaction
PS HKCU:\software> Get-ChildItem SS* -UseTransaction
^ displays the new key
PS HKCU:\software> Complete-Transaction
“With the greater part of rich people, the chief enjoyment of riches consists in the parade of riches” ~ Adam Smith
Start-Transaction - Start a new transaction.
Complete-Transaction - Complete a transaction.
Get-Transaction - Get information about the active transaction.
Use-Transaction - Add a command or expression to the transaction.
Undo-Transaction - Roll back a transaction.