@@ -102,7 +102,7 @@ class RegisterPSResourceRepository : PSCmdlet
102102 /// </summary>
103103 [ Parameter ]
104104 public SwitchParameter PassThru { get ; set ; }
105-
105+
106106 /// <summary>
107107 /// When specified, will overwrite information for any existing repository with the same name.
108108 /// </summary>
@@ -115,10 +115,14 @@ class RegisterPSResourceRepository : PSCmdlet
115115
116116 protected override void BeginProcessing ( )
117117 {
118+ WriteVerbose ( "In RegisterPSResourceRepository::BeginProcessing()" ) ;
118119 RepositorySettings . CheckRepositoryStore ( ) ;
120+ WriteVerbose ( "Done RegisterPSResourceRepository::BeginProcessing()" ) ;
121+
119122 }
120123 protected override void ProcessRecord ( )
121124 {
125+ WriteVerbose ( "In RegisterPSResourceRepository::ProcessRecord()" ) ;
122126 List < PSRepositoryInfo > items = new List < PSRepositoryInfo > ( ) ;
123127
124128 PSRepositoryInfo . APIVersion ? repoApiVersion = null ;
@@ -130,6 +134,7 @@ protected override void ProcessRecord()
130134 switch ( ParameterSetName )
131135 {
132136 case NameParameterSet :
137+ WriteDebug ( "In RegisterPSResourceRepository::NameParameterSet" ) ;
133138 if ( ! Utils . TryCreateValidUri ( uriString : Uri ,
134139 cmdletPassedIn : this ,
135140 uriResult : out _uri ,
@@ -140,6 +145,7 @@ protected override void ProcessRecord()
140145
141146 try
142147 {
148+ WriteDebug ( $ "Registering repository '{ Name } ' with uri '{ _uri } '") ;
143149 items . Add ( RepositorySettings . AddRepository ( Name , _uri , Priority , Trusted , repoApiVersion , CredentialInfo , Force , this , out string errorMsg ) ) ;
144150
145151 if ( ! string . IsNullOrEmpty ( errorMsg ) )
@@ -177,6 +183,7 @@ protected override void ProcessRecord()
177183 break ;
178184
179185 case RepositoriesParameterSet :
186+ WriteDebug ( "In RegisterPSResourceRepository::RepositoriesParameterSet" ) ;
180187 try
181188 {
182189 items = RepositoriesParameterSetHelper ( ) ;
@@ -212,14 +219,14 @@ private PSRepositoryInfo PSGalleryParameterSetHelper(int repoPriority, bool repo
212219 WriteDebug ( "In RegisterPSResourceRepository::PSGalleryParameterSetHelper()" ) ;
213220 Uri psGalleryUri = new Uri ( PSGalleryRepoUri ) ;
214221 WriteDebug ( "Internal name and uri values for PSGallery are hardcoded and validated. Priority and trusted values, if passed in, also validated" ) ;
215- var addedRepo = RepositorySettings . AddToRepositoryStore ( PSGalleryRepoName ,
216- psGalleryUri ,
217- repoPriority ,
218- repoTrusted ,
222+ var addedRepo = RepositorySettings . AddToRepositoryStore ( PSGalleryRepoName ,
223+ psGalleryUri ,
224+ repoPriority ,
225+ repoTrusted ,
219226 apiVersion : null ,
220- repoCredentialInfo : null ,
221- Force ,
222- this ,
227+ repoCredentialInfo : null ,
228+ Force ,
229+ this ,
223230 out string errorMsg ) ;
224231
225232 if ( ! string . IsNullOrEmpty ( errorMsg ) )
@@ -313,7 +320,7 @@ private PSRepositoryInfo RepoValidationHelper(Hashtable repo)
313320 "NullUriForRepositoriesParameterSetRegistration" ,
314321 ErrorCategory . InvalidArgument ,
315322 this ) ) ;
316-
323+
317324 return null ;
318325 }
319326
@@ -337,10 +344,10 @@ private PSRepositoryInfo RepoValidationHelper(Hashtable repo)
337344 return null ;
338345 }
339346
340- if ( repo . ContainsKey ( "ApiVersion" ) &&
347+ if ( repo . ContainsKey ( "ApiVersion" ) &&
341348 ( repo [ "ApiVersion" ] == null || String . IsNullOrEmpty ( repo [ "ApiVersion" ] . ToString ( ) ) ||
342- ! ( repo [ "ApiVersion" ] . ToString ( ) . Equals ( "Local" , StringComparison . OrdinalIgnoreCase ) || repo [ "ApiVersion" ] . ToString ( ) . Equals ( "V2" , StringComparison . OrdinalIgnoreCase ) ||
343- repo [ "ApiVersion" ] . ToString ( ) . Equals ( "V3" , StringComparison . OrdinalIgnoreCase ) || repo [ "ApiVersion" ] . ToString ( ) . Equals ( "NugetServer" , StringComparison . OrdinalIgnoreCase ) ||
349+ ! ( repo [ "ApiVersion" ] . ToString ( ) . Equals ( "Local" , StringComparison . OrdinalIgnoreCase ) || repo [ "ApiVersion" ] . ToString ( ) . Equals ( "V2" , StringComparison . OrdinalIgnoreCase ) ||
350+ repo [ "ApiVersion" ] . ToString ( ) . Equals ( "V3" , StringComparison . OrdinalIgnoreCase ) || repo [ "ApiVersion" ] . ToString ( ) . Equals ( "NugetServer" , StringComparison . OrdinalIgnoreCase ) ||
344351 repo [ "ApiVersion" ] . ToString ( ) . Equals ( "Unknown" , StringComparison . OrdinalIgnoreCase ) ) ) )
345352 {
346353 WriteError ( new ErrorRecord (
0 commit comments