winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

RemoveWinGetConfigurationHistoryCmdlet.cs (1492B)


      1 // -----------------------------------------------------------------------------
      2 // <copyright file="RemoveWinGetConfigurationHistoryCmdlet.cs" company="Microsoft Corporation">
      3 //     Copyright (c) Microsoft Corporation. Licensed under the MIT License.
      4 // </copyright>
      5 // -----------------------------------------------------------------------------
      6 
      7 namespace Microsoft.WinGet.Configuration.Cmdlets
      8 {
      9     using System.Management.Automation;
     10     using Microsoft.WinGet.Configuration.Engine.Commands;
     11     using Microsoft.WinGet.Configuration.Engine.PSObjects;
     12 
     13     /// <summary>
     14     /// Remove-WinGetConfigurationHistory.
     15     /// Removes the given configuration set from history.
     16     /// </summary>
     17     [Cmdlet(VerbsCommon.Remove, "WinGetConfigurationHistory")]
     18     [Alias("rwgch")]
     19     public sealed class RemoveWinGetConfigurationHistoryCmdlet : PSCmdlet
     20     {
     21         /// <summary>
     22         /// Gets or sets the configuration set.
     23         /// </summary>
     24         [Parameter(
     25             Position = 0,
     26             Mandatory = true,
     27             ValueFromPipeline = true,
     28             ValueFromPipelineByPropertyName = true)]
     29         public PSConfigurationSet Set { get; set; }
     30 
     31         /// <summary>
     32         /// Removes the given set from history.
     33         /// </summary>
     34         protected override void ProcessRecord()
     35         {
     36             var configCommand = new ConfigurationCommand(this);
     37             configCommand.Remove(this.Set);
     38         }
     39     }
     40 }