-
Notifications
You must be signed in to change notification settings - Fork 136
Added credential parameter to subsequent calls of Publish-Module/Script. #93
Conversation
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.
Hi @dotps1, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! The agreement was validated by Microsoft and real humans are currently evaluating your PR. TTYL, MSBOT; |
for the life of me i cannot figure out why the Script tests are failing with:
i will continue to look tonight, but this change needs to happen. |
…r not found error.
and the issues continue! OneGet/oneget#270 |
PowerShellGet/PSModule.psm1
Outdated
@@ -792,7 +792,7 @@ function Publish-Module | |||
|
|||
[Parameter(ValueFromPipelineByPropertyName=$true)] | |||
[PSCredential] | |||
$Credential, | |||
$Credential = $null, |
There was a problem hiding this comment.
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
PowerShellGet/PSModule.psm1
Outdated
@@ -1334,7 +1335,7 @@ function Find-Module | |||
|
|||
[Parameter(ValueFromPipelineByPropertyName=$true)] | |||
[PSCredential] | |||
$Credential | |||
$Credential = $null |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
|
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.