File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,14 @@ function Get-GQL
7474 # This can be useful for queries that would be run frequently, but change infrequently.
7575 [Parameter (ValueFromPipelineByPropertyName )]
7676 [switch ]
77- $Cache
77+ $Cache ,
78+
79+ # If set, will refresh the cache.
80+ # This can be useful to force an update of cached information.
81+ # `-Refresh` implies `-Cache` (it just will not return an uncached value).
82+ [Parameter (ValueFromPipelineByPropertyName )]
83+ [switch ]
84+ $Refresh
7885 )
7986
8087 process {
@@ -150,12 +157,17 @@ function Get-GQL
150157 }
151158 # endregion Check for File or Cached Query
152159
160+ if ($PSBoundParameters [' Refresh' ]) {
161+ $Cache = $true
162+ }
163+
153164 if ($Cache -and -not $script :GraphQLOutputCache ) {
154165 $script :GraphQLOutputCache = [Ordered ]@ {}
155166 }
156167
157168 if ($script :GraphQLOutputCache .$gqlQuery -and
158- -not $Parameter.Count
169+ -not $Parameter.Count -and
170+ -not $Refresh
159171 ) {
160172 $script :GraphQLOutputCache .$gqlQuery
161173 continue nextQuery
You can’t perform that action at this time.
0 commit comments