winget-cli

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

GetSettingCmdlet.cs (1249B)


      1 // -----------------------------------------------------------------------------
      2 // <copyright file="GetSettingCmdlet.cs" company="Microsoft Corporation">
      3 //     Copyright (c) Microsoft Corporation. Licensed under the MIT License.
      4 // </copyright>
      5 // -----------------------------------------------------------------------------
      6 
      7 namespace Microsoft.WinGet.Client.Cmdlets.Cmdlets
      8 {
      9     using System.Management.Automation;
     10     using Microsoft.WinGet.Client.Common;
     11     using Microsoft.WinGet.Client.Engine.Commands;
     12 
     13     /// <summary>
     14     /// Gets winget settings.
     15     /// </summary>
     16     [Cmdlet(VerbsCommon.Get, Constants.WinGetNouns.Setting)]
     17     [Alias("gwgse", "Get-WinGetSettings")]
     18     public sealed class GetSettingCmdlet : PSCmdlet
     19     {
     20         /// <summary>
     21         /// Gets or sets a value indicating whether to output a string or a hashtable.
     22         /// </summary>
     23         [Parameter(ValueFromPipelineByPropertyName = true)]
     24         public SwitchParameter AsPlainText { get; set; }
     25 
     26         /// <summary>
     27         /// Get settings.
     28         /// </summary>
     29         protected override void ProcessRecord()
     30         {
     31             var command = new CliCommand(this);
     32             command.GetSettings(this.AsPlainText.ToBool());
     33         }
     34     }
     35 }