Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Find-DscResource does not support -Credential #257

Open
@RemcoKapinga

Description

@RemcoKapinga

When using a private repository (for example, a VSTS / NuGet based repository), using Credentials is required. Find-Module and Find-Script support the use of a -Credential parameter, while Find-DscResource does not. Using a private repository for DscResources is not possible.

Expected Behavior

It would be expected that Find-DscResource takes a -Credential parameter

Find-DscResource -Name MyResource -Repository Private -Credential $credential

Current Behavior

Find-DscResource does not support -Credential

Without -Credential:

PS > Find-DscResource -Repository Dummy
WARNING: Cannot access 'https://my.pkgs.visualstudio.com/_packaging/Dummy/nuget/v2/'. Are you missing 'Credential'
parameter in the cmdlet?
WARNING: Unable to resolve package source 'https://my.pkgs.visualstudio.com/_packaging/Dummy/nuget/v2/'.

With -Credential:

PS > Find-DscResource -Repository Dummy -Credential $credential
Find-DscResource : A parameter cannot be found that matches parameter name 'Credential'.
At line:1 char:54
+ ... d-DscResource -Repository Dummy -Credential $credential ...
+                                     ~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Find-DscResource], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Find-DscResource

Possible Solution

Support providing credentials on Find-DscResource, equal to Find-Module or Find-Script.

Context

Working with a private VSTS / NuGet based repository, requiring credentials (a personal access token.

Activity

changed the title [-]Find-DscResource does not support -Credential (for private repositories)[/-] [+]Find-DscResource does not support -Credential[/+] on Apr 6, 2018
cpumanaz

cpumanaz commented on Jun 26, 2019

@cpumanaz

It appears this is important accross the board. I would like to use private feeds for provisioning Azure resources with DSC. I'm limited to the PS Gallery.

https://github.com/PowerShell/PowerShellGet/tree/development/DSC/Examples

The cmdlets that are wrapped here support a PSCredential object and Azure Automation supports PSCredentials. Would be great if the arguments for the DSC matched the cmdlets they wrap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Find-DscResource does not support -Credential · Issue #257 · PowerShell/PowerShellGetv2