dsccommunity / dsccommunity/SqlServerDsc

SqlPowerShellModule: New resource proposal

Open
#540 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted resource proposal
Dominant language
PowerShell
Stars
385
Forks
224
PR merge metrics
No merged PRs in 30d

Description

Now when SqlServer module has been release to PowerShell Gallery I think we need a resource that is able to download the module from either PowerShell Gallery or from an UNC share.

This might be better as a common resource that can download any module? Is there one already?

Suggested a start to a schema to discuss from.

[ClassVersion("1.0.0.0"), FriendlyName("SqlPowerShellModule")]
class MSFT_SqlPowerShellModule : OMI_BaseResource
{
    [Write, Description("If the SqlServer module should be present on absent on the server being configured."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure;
    [Write, Description("The path from where to copy (download) the SqlServer module. If not set the module will be downloaded from PowerShell gallery")] String Path;
    [Write, Description("If set to one or more registred repositories the module will be downloaded from one of those repositorys. If not set, then the module will be downloaded from PowerShell gallery. If parameter Path is set, this parameter will be ignored.")] String Repository[];
    [Write, Description("If this is set to $true and the same version already exists on the computer, then the downloaded module will be overwrite the existing module.")] Boolean Force;
    [Write, Description("The version that must be downloaded, if the version does not exists the resource will throw an error.")] Boolean RequiredVersion;
    [Write, EmbeddedInstance("MSFT_Credential"), Description("The credentials used to access the path set in the parameter Path. This is optional if downloading the module from a repository. This is also optional if either the SYSTEM account or the built-in PsDcsRunAsCredential has access to the path.")] String SourceCredential;
};

Parameters more easily read:

Parameter Description
Ensure If the SqlServer module should be present on absent on the server being configured.
Path The path from where to copy (download) the SqlServer module. If not set the module will be downloaded from PowerShell gallery.
Repository If set to one or more registred repositories the module will be downloaded from one of those repositorys. If not set, then the module will be downloaded from PowerShell gallery. If parameter Path is set, this parameter will be ignored.
Force If this is set to $true and the same version already exists on the computer, then the downloaded module will be overwrite the existing module.
RequiredVersion The version that must be downloaded, if the version does not exists the resource will throw an error.
SourceCredential The credentials used to access the path set in the parameter Path. This is optional if downloading the module from a repository. This is also optional if either the SYSTEM account or the built-in PsDcsRunAsCredential has access to the path.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by resolving whether this should be a SqlPowerShellModule resource or a common resource for downloading any PowerShell module. Review the proposed Ensure, Path, Repository, Force, RequiredVersion, and SourceCredential parameters, including PowerShell Gallery and UNC-share behavior. Done means the resource scope and parameter contract are agreed and implemented with coverage for the stated download sources and version requirements.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.