winget-cli

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

commit f4f8abd5f3232bbe2967e7c01c3c6e7a1071af01
parent 53ceda5743d9a3c9405da5a03bfee6d29222d7e7
Author: Gijs Reijn <gijsreijn@hotmail.com>
Date:   Fri, 17 Jan 2025 19:43:16 +0100

Add validateset attribute for relevant cmdlets (#5073)

This pull request adds the `ValidateSet` attribute for three cmdlets,
which will help users quickly discover the available types or setting
names.
Diffstat:
Msrc/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/AddSourceCmdlet.cs | 3+++
Msrc/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/DisableSettingCmdlet.cs | 6++++++
Msrc/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/EnableSettingCmdlet.cs | 6++++++
3 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/AddSourceCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/AddSourceCmdlet.cs @@ -42,6 +42,9 @@ namespace Microsoft.WinGet.Client.Cmdlets.Cmdlets [Parameter( ValueFromPipeline = true, ValueFromPipelineByPropertyName = true)] + [ValidateSet( + "Microsoft.Rest", + "Microsoft.PreIndexed.Package")] public string Type { get; set; } /// <summary> diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/DisableSettingCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/DisableSettingCmdlet.cs @@ -25,6 +25,12 @@ namespace Microsoft.WinGet.Client.Cmdlets.Cmdlets Mandatory = true, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true)] + [ValidateSet( + "LocalManifestFiles", + "BypassCertificatePinningForMicrosoftStore", + "InstallerHashOverride", + "LocalArchiveMalwareScanOverride", + "ProxyCommandLineOptions")] public string Name { get; set; } /// <summary> diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/EnableSettingCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/EnableSettingCmdlet.cs @@ -25,6 +25,12 @@ namespace Microsoft.WinGet.Client.Cmdlets.Cmdlets Mandatory = true, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true)] + [ValidateSet( + "LocalManifestFiles", + "BypassCertificatePinningForMicrosoftStore", + "InstallerHashOverride", + "LocalArchiveMalwareScanOverride", + "ProxyCommandLineOptions")] public string Name { get; set; } /// <summary>