2016-03-30 14:20:52 -07:00
|
|
|
/********************************************************************++
|
|
|
|
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
|
--********************************************************************/
|
2016-07-29 13:02:49 -07:00
|
|
|
|
2016-03-30 14:20:52 -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()
|
2016-03-30 14:20:52 -07:00
|
|
|
{
|
|
|
|
|
// Commit the transaction
|
2016-07-29 13:02:49 -07:00
|
|
|
if (ShouldProcess(
|
2016-03-30 14:20:52 -07:00
|
|
|
NavigationResources.TransactionResource,
|
|
|
|
|
NavigationResources.CommitAction))
|
|
|
|
|
{
|
|
|
|
|
this.Context.TransactionManager.Commit();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} // CommitTransactionCommand
|
|
|
|
|
} // namespace Microsoft.PowerShell.Commands
|
|
|
|
|
|