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

Added credential parameter to subsequent calls of Publish-Module/Script. #93

Merged
merged 4 commits into from
Feb 23, 2017
Merged

Conversation

dotps1
Copy link
Contributor

@dotps1 dotps1 commented Feb 21, 2017

This is needed when a module is published that has the RequiredModules attribute in the manifest, and is being published to a Repo that does not have Anonymous access because the required module lookups will fail because there is no read access to repo.

This is needed when a module is published that has the RequiredModules attribute in the manifest on a Repo that does not have Anonyomous access becauuse the required module lookups will fail.
@msftclas
Copy link

Hi @dotps1, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!

The agreement was validated by Microsoft and real humans are currently evaluating your PR.

TTYL, MSBOT;

@dotps1
Copy link
Contributor Author

dotps1 commented Feb 21, 2017

for the life of me i cannot figure out why the Script tests are failing with:

Publish-PSArtifactUtility : A parameter cannot be found that matches parameter name 'Credential'.

i will continue to look tonight, but this change needs to happen.

@dotps1
Copy link
Contributor Author

dotps1 commented Feb 22, 2017

and the issues continue! OneGet/oneget#270

@@ -792,7 +792,7 @@ function Publish-Module

[Parameter(ValueFromPipelineByPropertyName=$true)]
[PSCredential]
$Credential,
$Credential = $null,
Copy link
Contributor

@bmanikm bmanikm Feb 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

= $null [](start = 19, length = 8)

What is the need for specifying the default value? #Closed

@@ -1334,7 +1335,7 @@ function Find-Module

[Parameter(ValueFromPipelineByPropertyName=$true)]
[PSCredential]
$Credential
$Credential = $null
Copy link
Contributor

@bmanikm bmanikm Feb 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$Credential = $null [](start = 8, length = 19)

Please avoid parameters with $null as default values.
#Closed

Copy link
Contributor Author

@dotps1 dotps1 Feb 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed the default values. I swear there used to be a PSScriptAnalyzer rule that was like PSAvoidUninitalizedParamerterValues or something like that where basically if the parameter was not Mandatory, then it needed a default value. I suppose this would have worked as well:
Credential = [PSCredential]::Empty

Thanks.

@bmanikm
Copy link
Contributor

bmanikm commented Feb 23, 2017

:shipit:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants