Skip to content

Commit

Permalink
Remove attribute that is only in 7.4 in favor of explicit code to che…
Browse files Browse the repository at this point in the history
…ck value
  • Loading branch information
JohnMcPMS committed Oct 31, 2024
1 parent d60517e commit 2a4ea2c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/PowerShell/Microsoft.WinGet.DSC/Microsoft.WinGet.DSC.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ class WinGetAdminSettings
class WinGetSource
{
[DscProperty(Key, Mandatory)]
[ValidateNotNullOrWhiteSpace()]
[string]$Name

[DscProperty(Mandatory)]
Expand All @@ -210,6 +209,11 @@ class WinGetSource

[WinGetSource] Get()
{
if ([String]::IsNullOrWhiteSpace($this.Name))
{
throw "A value must be provided for WinGetSource::Name"
}

$currentSource = $null

try {
Expand Down Expand Up @@ -446,7 +450,6 @@ class WinGetPackageManager
class WinGetPackage
{
[DscProperty(Key, Mandatory)]
[ValidateNotNullOrWhiteSpace()]
[string]$Id

[DscProperty(Key)]
Expand All @@ -471,6 +474,11 @@ class WinGetPackage

[WinGetPackage] Get()
{
if ([String]::IsNullOrWhiteSpace($this.Name))
{
throw "A value must be provided for WinGetPackage::Id"
}

$result = [WinGetPackage]::new()

$hashArgs = @{
Expand Down

0 comments on commit 2a4ea2c

Please sign in to comment.