Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove attribute in DSC #4932

Merged
merged 2 commits into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.Id))
{
throw "A value must be provided for WinGetPackage::Id"
}

$result = [WinGetPackage]::new()

$hashArgs = @{
Expand Down
Loading