From b884b798ac8d6370b0a32bffaa937d5bce8f1bd7 Mon Sep 17 00:00:00 2001 From: William Gladstone Date: Thu, 10 Oct 2024 13:02:25 -0400 Subject: [PATCH 1/2] Update Caching.ps1 Addresses https://github.com/Badgerati/Pode/issues/1412 --- src/Public/Caching.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Public/Caching.ps1 b/src/Public/Caching.ps1 index 3be0951d8..b5163757f 100644 --- a/src/Public/Caching.ps1 +++ b/src/Public/Caching.ps1 @@ -462,6 +462,7 @@ if (Test-PodeCacheStorage -Name 'ExampleStorage') { } function Test-PodeCacheStorage { [CmdletBinding()] param( + [Alias('Key')] [Parameter(Mandatory = $true)] [string] $Name @@ -554,4 +555,4 @@ function Get-PodeCacheDefaultTtl { param() return $PodeContext.Server.Cache.DefaultTtl -} \ No newline at end of file +} From 7097bc3479d92826ea72334301f7b28f0931e106 Mon Sep 17 00:00:00 2001 From: William Gladstone Date: Fri, 11 Oct 2024 17:56:01 -0400 Subject: [PATCH 2/2] Update Caching.ps1 - Remove Alias. - Fix Test-PodeCacheStorage function calls to use 'Name' parameter. --- src/Public/Caching.ps1 | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Public/Caching.ps1 b/src/Public/Caching.ps1 index b5163757f..93f7cef5b 100644 --- a/src/Public/Caching.ps1 +++ b/src/Public/Caching.ps1 @@ -52,7 +52,7 @@ function Get-PodeCache { } # used custom storage - if (Test-PodeCacheStorage -Key $Storage) { + if (Test-PodeCacheStorage -Name $Storage) { return (Invoke-PodeScriptBlock -ScriptBlock $PodeContext.Server.Cache.Storage[$Storage].Get -Arguments @($Key, $Metadata.IsPresent) -Splat -Return) } @@ -150,7 +150,7 @@ function Set-PodeCache { } # used custom storage - elseif (Test-PodeCacheStorage -Key $Storage) { + elseif (Test-PodeCacheStorage -Name $Storage) { $null = Invoke-PodeScriptBlock -ScriptBlock $PodeContext.Server.Cache.Storage[$Storage].Set -Arguments @($Key, $InputObject, $Ttl) -Splat } @@ -204,7 +204,7 @@ function Test-PodeCache { } # used custom storage - if (Test-PodeCacheStorage -Key $Storage) { + if (Test-PodeCacheStorage -Name $Storage) { return (Invoke-PodeScriptBlock -ScriptBlock $PodeContext.Server.Cache.Storage[$Storage].Test -Arguments @($Key) -Splat -Return) } @@ -255,7 +255,7 @@ function Remove-PodeCache { } # used custom storage - elseif (Test-PodeCacheStorage -Key $Storage) { + elseif (Test-PodeCacheStorage -Name $Storage) { $null = Invoke-PodeScriptBlock -ScriptBlock $PodeContext.Server.Cache.Storage[$Storage].Remove -Arguments @($Key) -Splat } @@ -301,7 +301,7 @@ function Clear-PodeCache { } # used custom storage - elseif (Test-PodeCacheStorage -Key $Storage) { + elseif (Test-PodeCacheStorage -Name $Storage) { $null = Invoke-PodeScriptBlock -ScriptBlock $PodeContext.Server.Cache.Storage[$Storage].Clear } @@ -462,7 +462,6 @@ if (Test-PodeCacheStorage -Name 'ExampleStorage') { } function Test-PodeCacheStorage { [CmdletBinding()] param( - [Alias('Key')] [Parameter(Mandatory = $true)] [string] $Name