-
Notifications
You must be signed in to change notification settings - Fork 98
Refactor SetPSResourceRepository cmdlet #359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor SetPSResourceRepository cmdlet #359
Conversation
not sure how to implement the Credential parameter to be honest |
@anamnavi I think the credential param should be completely removed. If we need it later on with the integration of credential persistence we can add it back then, but there's currently no need for it. |
I copied the
|
For Set: allow by pipeline just Name, and REpositories. For Register, ok as is. |
@@ -114,10 +114,11 @@ public static PSRepositoryInfo Add(string repoName, Uri repoURL, int repoPriorit | |||
/// Updates a repository name, URL, priority, or installation policy | |||
/// Returns: void | |||
/// </summary> | |||
public static void Update(string repoName, Uri repoURL, int repoPriority, bool? repoTrusted) | |||
public static PSRepositoryInfo Update(string repoName, Uri repoURL, int repoPriority, bool? repoTrusted) |
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.
Please update comment (// Returns: void)
@@ -132,28 +133,47 @@ public static void Update(string repoName, Uri repoURL, int repoPriority, bool? | |||
// Get root of XDocument (XElement) |
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.
On line 129, error is not ArgumentException, the argument is valid. Should be ItemNotFoundException error.
* added implemenation and test for Set * remove unnecessary comments * add some summary parameter comments * remove more comments * remove NameParameterSetHelper() * add test and code for detecting if name key in repositories param is null * update help doc for Set * fix codacy issues * add Debug statements * add newline at end of SetPSResourceRepository.cs file * used parameterset name const variables instead of parameter set strings * remove Credential parameter * remove Proxy and ProxyCredential parameters * remove Credential parameter from help docs as well * trim whitespace with Trim(), no param needed * order directives alphabetically * remove Priority and URL parameters from pipeline
This PR includes refactoring for Set-PSResourceRepository cmdlet. This cmdlet updates repository info, so I also had to update code in the Update() method in RepositorySettings.cs. I also included a
-PassThru
parameter for this cmdlet, and the output is of type PSRepositoryInfo class (which was created in a previous PR).PR Summary
summary of changes included in this PR:
resolves issues:
PR Context
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.