Badgerati / Pode

Pode is a Cross-Platform PowerShell web framework for creating REST APIs, Web Sites, and TCP/SMTP servers
https://badgerati.github.io/Pode
MIT License
866 stars 92 forks source link

Test-PodeCacheStorage called with incorrect param #1412

Closed willgladstone closed 1 month ago

willgladstone commented 1 month ago

Describe the Bug

When using Redis as external cache storage, the below error is thrown


Line |
 153 |          elseif (Test-PodeCacheStorage -Key $Storage) {
     |                                        ~~~~
     | A parameter cannot be found that matches parameter name 'Key'.```

### Problematic Code References
https://github.com/Badgerati/Pode/blob/21c76a16c0b57caa459fbc9de4a7d13b412133c1/src/Public/Caching.ps1#L55
https://github.com/Badgerati/Pode/blob/21c76a16c0b57caa459fbc9de4a7d13b412133c1/src/Public/Caching.ps1#L153
https://github.com/Badgerati/Pode/blob/21c76a16c0b57caa459fbc9de4a7d13b412133c1/src/Public/Caching.ps1#L207
https://github.com/Badgerati/Pode/blob/21c76a16c0b57caa459fbc9de4a7d13b412133c1/src/Public/Caching.ps1#L258
https://github.com/Badgerati/Pode/blob/21c76a16c0b57caa459fbc9de4a7d13b412133c1/src/Public/Caching.ps1#L304

### Expected Behavior
The Test-PodeCacheStorage expects a `Name` parameter.

### Additional Context
Not sure of the preferred fixed here. The least intrusive is to set an alias, or the params could be fixed to used the correct parameter name.
Badgerati commented 1 month ago

Fixed via #1413