WinGet Command Not Found is a PowerShell 7 module to help you install missing packages. With this module, you will be recommended relevant WinGet packages whenever an unrecognized command is entered.
WarmUp() asynchronously calls Find-WinGetPackage when the module is imported to pre-load the WinGet database so that future calls are faster.
For #8, a PipelineStoppedException would occur when the user exits or ^C during that async call.
For #9, a CmdletInvocationException would occur from Microsoft.WinGet.Client failing to create some WinGet objects.
We're normally able to handle an exception here, but we don't actually have any error handling in WarmUp(). This just adds a catch there.
Though we don't actually do anything with the error there, here's what's expected from the situations encountered:
PipelineStoppedException from exit: exception is caught and the user exited the session, so we silently didn't warm up and that's fine
PipelineStoppedException from ^C: exception is caught and warm up is cancelled. _warmedUp is still set to true so we'll just load the WinGet db on first run
CmdletInvocationException: unsure why WinGet wasn't able to connect, but we handle the exception here and silently continue. When the feedback provider is used again, if we get an exception, we present the error from here.
WarmUp()
asynchronously callsFind-WinGetPackage
when the module is imported to pre-load the WinGet database so that future calls are faster.For #8, a
PipelineStoppedException
would occur when the userexit
s or^C
during that async call. For #9, aCmdletInvocationException
would occur fromMicrosoft.WinGet.Client
failing to create some WinGet objects.We're normally able to handle an exception here, but we don't actually have any error handling in
WarmUp()
. This just adds a catch there.Though we don't actually do anything with the error there, here's what's expected from the situations encountered:
PipelineStoppedException
fromexit
: exception is caught and the user exited the session, so we silently didn't warm up and that's finePipelineStoppedException
from^C
: exception is caught and warm up is cancelled._warmedUp
is still set totrue
so we'll just load the WinGet db on first runCmdletInvocationException
: unsure why WinGet wasn't able to connect, but we handle the exception here and silently continue. When the feedback provider is used again, if we get an exception, we present the error from here.Closes #7 Closes #8 Closes #9