Files
PowerShell/src/Microsoft.PowerShell.Commands.Management/commands/management/CommitTransactionCommand.cs
T

31 lines
1.1 KiB
C#
Raw Normal View History

/********************************************************************++
Copyright (c) Microsoft Corporation. All rights reserved.
--********************************************************************/
2016-07-29 13:02:49 -07:00
using System.Management.Automation;
using Dbg = System.Management.Automation;
namespace Microsoft.PowerShell.Commands
{
/// <summary>
/// A command that commits a transaction.
/// </summary>
[Cmdlet(VerbsLifecycle.Complete, "Transaction", SupportsShouldProcess = true, HelpUri = "http://go.microsoft.com/fwlink/?LinkID=135200")]
public class CompleteTransactionCommand : PSCmdlet
{
/// <summary>
/// Commits the current transaction
/// </summary>
2016-07-29 13:02:49 -07:00
protected override void EndProcessing()
{
// Commit the transaction
2016-07-29 13:02:49 -07:00
if (ShouldProcess(
NavigationResources.TransactionResource,
NavigationResources.CommitAction))
{
this.Context.TransactionManager.Commit();
}
}
} // CommitTransactionCommand
} // namespace Microsoft.PowerShell.Commands