Skip to content

Remove hard-coding of input parameters #4

@leshkinski

Description

@leshkinski

Problem:
Semi-hard coded variables being used within the resource code are difficult to identify and add to development/support burden. This example prevents us from moving to things like encrypted secrets file easily and results in too much development overhead.

$d = Get-Content $(Join-Path ([Environment]::GetEnvironmentVariable('defaultPath','Machine')) 'secrets.json') -Raw | ConvertFrom-Json
.....
... $('CN=', $d.PullServerAddress -join ''), -ss ...

Proposed solution:
Convert all such variables into parameters that can be passed to the resource as part of the DSC configuration that is calling it. If we want to offer sensible defaults then these can be assigned within the parameter block.

Problem code:
https://github.com/rsWinAutomationSupport/rsDSCCert/blob/universal/DSCResources/RS_rsPullCert/RS_rsPullCert.psm1#L28

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions