File tree 1 file changed +14
-2
lines changed
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,14 @@ function Get-GQL
74
74
# This can be useful for queries that would be run frequently, but change infrequently.
75
75
[Parameter (ValueFromPipelineByPropertyName )]
76
76
[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
78
85
)
79
86
80
87
process {
@@ -150,12 +157,17 @@ function Get-GQL
150
157
}
151
158
# endregion Check for File or Cached Query
152
159
160
+ if ($PSBoundParameters [' Refresh' ]) {
161
+ $Cache = $true
162
+ }
163
+
153
164
if ($Cache -and -not $script :GraphQLOutputCache ) {
154
165
$script :GraphQLOutputCache = [Ordered ]@ {}
155
166
}
156
167
157
168
if ($script :GraphQLOutputCache .$gqlQuery -and
158
- -not $Parameter.Count
169
+ -not $Parameter.Count -and
170
+ -not $Refresh
159
171
) {
160
172
$script :GraphQLOutputCache .$gqlQuery
161
173
continue nextQuery
You can’t perform that action at this time.
0 commit comments