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
Description
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.