File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -234,6 +234,11 @@ function Install-ModuleFast {
234234 # Setup the Destination repository
235235 $defaultRepoPath = $ (Join-Path ([Environment ]::GetFolderPath(' LocalApplicationData' )) ' powershell/Modules' )
236236
237+ # Clear the ModuleFastCache if -Update is specified to ensure fresh lookups of remote module availability
238+ if ($Update ) {
239+ Clear-ModuleFastCache
240+ }
241+
237242 if (-not $Destination ) {
238243 $Destination = $defaultRepoPath
239244 } elseif ($IsWindows -and $Destination -eq ' CurrentUser' ) {
@@ -827,6 +832,7 @@ function Clear-ModuleFastCache {
827832 . SYNOPSIS
828833 Clears the ModuleFast HTTP Cache. This is useful if you are expecting a newer version of a module to be available.
829834 #>
835+ Write-Debug " Flushing ModuleFast Request Cache"
830836 $SCRIPT :RequestCache.Dispose ()
831837 $SCRIPT :RequestCache = [MemoryCache ]::new(' PowerShell-ModuleFast-RequestCache' )
832838}
You can’t perform that action at this time.
0 commit comments