Commit f8316d7
fix(Get-Dependency): correct operator precedence in Parse-Dependency elseif conditions
When DependencyType was set globally via PSDependOptions, PowerShell's
-and/-or precedence caused the simple-string elseif branches to match
even for hashtable-syntax dependencies, assigning the whole hashtable
to Version instead of parsing it correctly.
Parenthesise the (-not $DependencyType -or $DependencyType -eq 'X')
sub-expression in all three branches (PSGalleryModule, GitHub, Git).
Fixes #131
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 73b06ec commit f8316d7
1 file changed
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
262 | | - | |
| 261 | + | |
| 262 | + | |
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
288 | | - | |
| 287 | + | |
| 288 | + | |
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | | - | |
312 | | - | |
| 311 | + | |
| 312 | + | |
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| |||
0 commit comments