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

DSC Resource #58

Closed
ThomasNieto opened this issue Mar 5, 2023 · 2 comments
Closed

DSC Resource #58

ThomasNieto opened this issue Mar 5, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@ThomasNieto
Copy link
Member

Create a module that contains DSC resources.

enum Ensure {
    Present
    Absent
}

[DscResource()]
class Package {
    [DscProperty(Key)]
    [string] $Name

    [DscProperty(Key)]
    [string] $Version = '*'

    [DscProperty(Key)]
    [string] $Provider

    [DscProperty()]
    [bool] $Prerelease

    [DscProperty()]
    [string] $Source

    [DscProperty()]
    [hashtable] $AdditionalParameters

    [DscProperty()]
    [Ensure] $Ensure = [Ensure]::Present

    [Package] Get() { }
    [void] Set() { }
    [bool] Test() { }
}

[DscResource()]
class Source {
    [DscProperty(Key)]
    [string] $Name

    [DscProperty(Key)]
    [string] $Provider

    [DscProperty(Mandatory)]
    [string] $Location

    [DscProperty()]
    [bool] $Trusted

    [DscProperty()]
    [hashtable] $AdditionalParameters

    [DscProperty()]
    [Ensure] $Ensure = [Ensure]::Present

    [Source] Get() { }
    [void] Set() { }
    [bool] Test() { }
}
@ThomasNieto ThomasNieto added the enhancement New feature or request label Mar 5, 2023
@ThomasNieto
Copy link
Member Author

Blocked by PowerShell/PSDesiredStateConfiguration#101 unless a new module is used.

@ThomasNieto
Copy link
Member Author

Created separate module for DSC resources in AnyPackageDsc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant