@@ -147,7 +147,7 @@ function Get-Dependency {
147147 [hashtable ]$Credentials
148148 )
149149
150- # Helper to pick from global psdependoptions , or return a default
150+ # Helper to pick from global PSDependOptions , or return a default
151151 function Get-GlobalOption {
152152 param (
153153 $Options = $PSDependOptions ,
@@ -159,12 +159,10 @@ function Get-Dependency {
159159 $Output = $Default
160160 if ($Prefer ) {
161161 $Output = $Prefer
162- }
163- else {
162+ } else {
164163 try {
165164 $Output = $Options [$Name ]
166- }
167- catch {
165+ } catch {
168166 $Output = $Default
169167 }
170168 }
@@ -262,7 +260,7 @@ function Get-Dependency {
262260 elseif ( $DependencyHash -is [string ] -and
263261 $Dependency -notmatch ' /' -and
264262 (-not $DependencyType -or
265- $DependencyType -eq ' PSGalleryModule' )) {
263+ $DependencyType -eq ' PSGalleryModule' )) {
266264 [PSCustomObject ]@ {
267265 PSTypeName = ' PSDepend.Dependency'
268266 DependencyFile = $DependencyFile
@@ -288,7 +286,7 @@ function Get-Dependency {
288286 $Dependency -match ' /' -and
289287 $Dependency.split (' /' ).count -eq 2 -and
290288 (-not $DependencyType -or
291- $DependencyType -eq ' GitHub' )) {
289+ $DependencyType -eq ' GitHub' )) {
292290 [PSCustomObject ]@ {
293291 PSTypeName = ' PSDepend.Dependency'
294292 DependencyFile = $DependencyFile
@@ -312,7 +310,7 @@ function Get-Dependency {
312310 elseif ($DependencyHash -is [string ] -and
313311 $Dependency -match ' /' -and
314312 (-not $DependencyType -or
315- $DependencyType -eq ' Git' )) {
313+ $DependencyType -eq ' Git' )) {
316314 [PSCustomObject ]@ {
317315 PSTypeName = ' PSDepend.Dependency'
318316 DependencyFile = $DependencyFile
@@ -331,8 +329,7 @@ function Get-Dependency {
331329 PSDependOptions = $PSDependOptions
332330 Raw = $null
333331 }
334- }
335- else {
332+ } else {
336333 # Parse dependency hash format
337334 # Default type is module, unless it's in a git-style format
338335 if (-not $DependencyHash.DependencyType ) {
@@ -343,10 +340,10 @@ function Get-Dependency {
343340 elseif (
344341 # Ugly right? Watch out for split called on hashtable...
345342 ($Dependency -match ' /' -and -not $Dependency.Name -and
346- ($Dependency -is [string ] -and $Dependency.split (' /' ).count -eq 2 )
343+ ($Dependency -is [string ] -and $Dependency.split (' /' ).count -eq 2 )
347344 ) -or
348345 ($DependencyHash.Name -match ' /' -and
349- ($DependencyHash -is [string ] -and $DependencyHash.split (' /' ).count -eq 2 )
346+ ($DependencyHash -is [string ] -and $DependencyHash.split (' /' ).count -eq 2 )
350347 )
351348 ) {
352349 $DependencyType = ' GitHub'
@@ -357,13 +354,11 @@ function Get-Dependency {
357354 $DependencyHash.Name -match ' /'
358355 ) {
359356 $DependencyType = ' Git'
360- }
361- else {
357+ } else {
362358 # finally, psgallerymodule
363359 $DependencyType = ' PSGalleryModule'
364360 }
365- }
366- else {
361+ } else {
367362 $DependencyType = $DependencyHash.DependencyType
368363 }
369364
@@ -403,8 +398,7 @@ function Get-Dependency {
403398
404399 if ($Credentials.ContainsKey ($Name )) {
405400 $credential = $Credentials [$Name ]
406- }
407- else {
401+ } else {
408402 Write-Warning " No credential found for the specified name $Name . Was the dependency misconfigured?"
409403 }
410404 }
@@ -419,8 +413,7 @@ function Get-Dependency {
419413
420414 if (Test-Path $DependencyPath - PathType Container) {
421415 $DependencyFiles = @ ( Resolve-DependScripts - Path $DependencyPath - Recurse $Recurse )
422- }
423- else {
416+ } else {
424417 $DependencyFiles = @ ( $DependencyPath )
425418 }
426419 $DependencyFiles = $DependencyFiles | Select-Object - Unique
@@ -434,8 +427,7 @@ function Get-Dependency {
434427 Parse- Dependency - ParamSet $PSCmdlet.ParameterSetName
435428 }
436429 }
437- }
438- elseif ($PSCmdlet.ParameterSetName -eq ' Hashtable' ) {
430+ } elseif ($PSCmdlet.ParameterSetName -eq ' Hashtable' ) {
439431 $DependencyFile = ' Hashtable'
440432 $ParsedDependencies = foreach ($InputDependency in $InputObject ) {
441433 $Dependencies = $InputDependency.Clone ()
0 commit comments