@@ -105,7 +105,7 @@ public IEnumerable<PSResourceInfo> FindByResourceName(
105
105
if ( repository != null )
106
106
{
107
107
// Write error and disregard repository entries containing wildcards.
108
- repository = Utils . ProcessNameWildcards ( repository , removeWildcardEntries : false , out string [ ] errorMsgs , out _repositoryNameContainsWildcard ) ;
108
+ repository = Utils . ProcessNameWildcards ( repository , removeWildcardEntries : false , out string [ ] errorMsgs , out _repositoryNameContainsWildcard ) ;
109
109
foreach ( string error in errorMsgs )
110
110
{
111
111
_cmdletPassedIn . WriteError ( new ErrorRecord (
@@ -156,7 +156,7 @@ public IEnumerable<PSResourceInfo> FindByResourceName(
156
156
if ( repositoriesToSearch != null && repositoriesToSearch . Count == 0 )
157
157
{
158
158
_cmdletPassedIn . ThrowTerminatingError ( new ErrorRecord (
159
- new PSArgumentException ( "Cannot resolve -Repository name. Run 'Get-PSResourceRepository' to view all registered repositories." ) ,
159
+ new PSArgumentException ( "Cannot resolve -Repository name. Run 'Get-PSResourceRepository' to view all registered repositories." ) ,
160
160
"RepositoryNameIsNotResolved" ,
161
161
ErrorCategory . InvalidArgument ,
162
162
this ) ) ;
@@ -222,7 +222,8 @@ public IEnumerable<PSResourceInfo> FindByResourceName(
222
222
bool shouldReportErrorForEachRepo = ! suppressErrors && ! _repositoryNameContainsWildcard ;
223
223
foreach ( PSResourceInfo currentPkg in SearchByNames ( currentServer , currentResponseUtil , currentRepository , shouldReportErrorForEachRepo ) )
224
224
{
225
- if ( currentPkg == null ) {
225
+ if ( currentPkg == null )
226
+ {
226
227
_cmdletPassedIn . WriteDebug ( "No packages returned from server" ) ;
227
228
continue ;
228
229
}
@@ -244,7 +245,7 @@ public IEnumerable<PSResourceInfo> FindByResourceName(
244
245
{
245
246
// Scenarios: Find-PSResource -Name "pkg" -> write error only if pkg wasn't found in any registered repositories
246
247
// Scenarios: Find-PSResource -Name "pkg" -Repository *Gallery -> write error if only if pkg wasn't found in any matching repositories.
247
- foreach ( string pkgName in pkgsDiscovered )
248
+ foreach ( string pkgName in pkgsDiscovered )
248
249
{
249
250
var msg = repository == null ? $ "Package '{ pkgName } ' could not be found in any registered repositories." :
250
251
$ "Package '{ pkgName } ' could not be found in registered repositories: '{ string . Join ( ", " , repositoryNamesToSearch ) } '.";
@@ -256,7 +257,7 @@ public IEnumerable<PSResourceInfo> FindByResourceName(
256
257
this ) ) ;
257
258
}
258
259
}
259
- }
260
+ }
260
261
261
262
public IEnumerable < PSCommandResourceInfo > FindByCommandOrDscResource (
262
263
bool isSearchingForCommands ,
@@ -283,12 +284,12 @@ public IEnumerable<PSCommandResourceInfo> FindByCommandOrDscResource(
283
284
// Error out if repository array of names to be searched contains wildcards.
284
285
if ( repository != null )
285
286
{
286
- repository = Utils . ProcessNameWildcards ( repository , removeWildcardEntries : false , out string [ ] errorMsgs , out _repositoryNameContainsWildcard ) ;
287
+ repository = Utils . ProcessNameWildcards ( repository , removeWildcardEntries : false , out string [ ] errorMsgs , out _repositoryNameContainsWildcard ) ;
287
288
288
289
if ( string . Equals ( repository [ 0 ] , "*" ) )
289
290
{
290
291
_cmdletPassedIn . ThrowTerminatingError ( new ErrorRecord (
291
- new PSArgumentException ( "-Repository parameter does not support entry '*' with -CommandName and -DSCResourceName parameters." ) ,
292
+ new PSArgumentException ( "-Repository parameter does not support entry '*' with -CommandName and -DSCResourceName parameters." ) ,
292
293
"RepositoryDoesNotSupportWildcardEntryWithCmdOrDSCName" ,
293
294
ErrorCategory . InvalidArgument ,
294
295
this ) ) ;
@@ -337,7 +338,7 @@ public IEnumerable<PSCommandResourceInfo> FindByCommandOrDscResource(
337
338
if ( repositoriesToSearch != null && repositoriesToSearch . Count == 0 )
338
339
{
339
340
_cmdletPassedIn . ThrowTerminatingError ( new ErrorRecord (
340
- new PSArgumentException ( "Cannot resolve -Repository name. Run 'Get-PSResourceRepository' to view all registered repositories." ) ,
341
+ new PSArgumentException ( "Cannot resolve -Repository name. Run 'Get-PSResourceRepository' to view all registered repositories." ) ,
341
342
"RepositoryNameIsNotResolved" ,
342
343
ErrorCategory . InvalidArgument ,
343
344
this ) ) ;
@@ -487,12 +488,12 @@ public IEnumerable<PSResourceInfo> FindByTag(
487
488
488
489
if ( repository != null )
489
490
{
490
- repository = Utils . ProcessNameWildcards ( repository , removeWildcardEntries : false , out string [ ] errorMsgs , out _repositoryNameContainsWildcard ) ;
491
+ repository = Utils . ProcessNameWildcards ( repository , removeWildcardEntries : false , out string [ ] errorMsgs , out _repositoryNameContainsWildcard ) ;
491
492
492
493
if ( string . Equals ( repository [ 0 ] , "*" ) )
493
494
{
494
495
_cmdletPassedIn . ThrowTerminatingError ( new ErrorRecord (
495
- new PSArgumentException ( "-Repository parameter does not support entry '*' with -Tag parameter." ) ,
496
+ new PSArgumentException ( "-Repository parameter does not support entry '*' with -Tag parameter." ) ,
496
497
"RepositoryDoesNotSupportWildcardEntryWithTag" ,
497
498
ErrorCategory . InvalidArgument ,
498
499
this ) ) ;
@@ -541,7 +542,7 @@ public IEnumerable<PSResourceInfo> FindByTag(
541
542
if ( repositoriesToSearch != null && repositoriesToSearch . Count == 0 )
542
543
{
543
544
_cmdletPassedIn . ThrowTerminatingError ( new ErrorRecord (
544
- new PSArgumentException ( "Cannot resolve -Repository name. Run 'Get-PSResourceRepository' to view all registered repositories." ) ,
545
+ new PSArgumentException ( "Cannot resolve -Repository name. Run 'Get-PSResourceRepository' to view all registered repositories." ) ,
545
546
"RepositoryNameIsNotResolved" ,
546
547
ErrorCategory . InvalidArgument ,
547
548
this ) ) ;
@@ -635,7 +636,7 @@ public IEnumerable<PSResourceInfo> FindByTag(
635
636
if ( currentResult . exception != null && ! currentResult . exception . Message . Equals ( string . Empty ) )
636
637
{
637
638
errRecord = new ErrorRecord (
638
- new ResourceNotFoundException ( $ "Tags '{ String . Join ( ", " , _tag ) } ' could not be found" , currentResult . exception ) ,
639
+ new ResourceNotFoundException ( $ "Tags '{ String . Join ( ", " , _tag ) } ' could not be found", currentResult . exception ) ,
639
640
"FindTagConvertToPSResourceFailure" ,
640
641
ErrorCategory . InvalidResult ,
641
642
this ) ;
@@ -729,7 +730,7 @@ private IEnumerable<PSResourceInfo> SearchByNames(ServerApiCall currentServer, R
729
730
}
730
731
}
731
732
}
732
- else if ( pkgName . Contains ( "*" ) )
733
+ else if ( pkgName . Contains ( "*" ) )
733
734
{
734
735
// Example: Find-PSResource -Name "Az*"
735
736
// Example: Find-PSResource -Name "Az*" -Tag "Storage"
@@ -1000,12 +1001,6 @@ private IEnumerable<PSResourceInfo> SearchByNames(ServerApiCall currentServer, R
1000
1001
// After retrieving all packages find their dependencies
1001
1002
if ( _includeDependencies )
1002
1003
{
1003
- if ( currentServer . Repository . ApiVersion == PSRepositoryInfo . APIVersion . V3 )
1004
- {
1005
- _cmdletPassedIn . WriteWarning ( "Installing dependencies is not currently supported for V3 server protocol repositories. The package will be installed without installing dependencies." ) ;
1006
- yield break ;
1007
- }
1008
-
1009
1004
foreach ( PSResourceInfo currentPkg in parentPkgs )
1010
1005
{
1011
1006
_cmdletPassedIn . WriteDebug ( $ "Finding dependency packages for '{ currentPkg . Name } '") ;
@@ -1102,7 +1097,8 @@ internal IEnumerable<PSResourceInfo> FindDependencyPackages(
1102
1097
{
1103
1098
_cmdletPassedIn . WriteVerbose ( errRecord . Exception . Message ) ;
1104
1099
}
1105
- else {
1100
+ else
1101
+ {
1106
1102
_cmdletPassedIn . WriteError ( errRecord ) ;
1107
1103
}
1108
1104
yield return null ;
@@ -1164,7 +1160,8 @@ internal IEnumerable<PSResourceInfo> FindDependencyPackages(
1164
1160
{
1165
1161
_cmdletPassedIn . WriteVerbose ( errRecord . Exception . Message ) ;
1166
1162
}
1167
- else {
1163
+ else
1164
+ {
1168
1165
_cmdletPassedIn . WriteError ( errRecord ) ;
1169
1166
}
1170
1167
yield return null ;
@@ -1199,7 +1196,8 @@ internal IEnumerable<PSResourceInfo> FindDependencyPackages(
1199
1196
// Check to see if version falls within version range
1200
1197
PSResourceInfo foundDep = currentResult . returnedObject ;
1201
1198
string depVersionStr = $ "{ foundDep . Version } ";
1202
- if ( foundDep . IsPrerelease ) {
1199
+ if ( foundDep . IsPrerelease )
1200
+ {
1203
1201
depVersionStr += $ "-{ foundDep . Prerelease } ";
1204
1202
}
1205
1203
@@ -1222,7 +1220,8 @@ internal IEnumerable<PSResourceInfo> FindDependencyPackages(
1222
1220
yield return depRes ;
1223
1221
}
1224
1222
}
1225
- else {
1223
+ else
1224
+ {
1226
1225
List < string > pkgVersions = _packagesFound [ depPkg . Name ] as List < string > ;
1227
1226
// _packagesFound has depPkg.name in it, but the version is not the same
1228
1227
if ( ! pkgVersions . Contains ( FormatPkgVersionString ( depPkg ) ) )
0 commit comments