Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Populates the $Error variable #25

Closed
farzadmf opened this issue Apr 17, 2019 · 2 comments
Closed

Populates the $Error variable #25

farzadmf opened this issue Apr 17, 2019 · 2 comments

Comments

@farzadmf
Copy link

Hi,

First of all, thank you for this useful module.

I just noticed something, which may or may not affect #23 (slow start), I noticed that whenever I start a PS session, my $Error variable is populated with all kinds of errors:

Get-Command : The term 'fgs' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Program Files\WindowsPowerShell\Modules\PSFzf\1.1.23\PSFzf.Functions.ps1:11 char:15
+ ...   if (-not (Get-Command -Name $Name -ErrorAction SilentlyContinue)) { ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (fgs:String) [Get-Command], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand

Get-Command : The term 'fz' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Program Files\WindowsPowerShell\Modules\PSFzf\1.1.23\PSFzf.Functions.ps1:11 char:15
+ ...   if (-not (Get-Command -Name $Name -ErrorAction SilentlyContinue)) { ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (fz:String) [Get-Command], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand

Get-Variable : Cannot find a variable with the name 'IsWindows'.
At C:\Program Files\WindowsPowerShell\Modules\ZLocation\1.1.0\ZLocation.Search.psm1:3 char:5
+ if((Get-Variable IsWindows -ErrorAction SilentlyContinue) -eq $null)  ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (IsWindows:String) [Get-Variable], ItemNotFoundException
    + FullyQualifiedErrorId : VariableNotFound,Microsoft.PowerShell.Commands.GetVariableCommand

Get-Variable : Cannot find a variable with the name 'IsMacOS'.
At C:\Program Files\WindowsPowerShell\Modules\ZLocation\1.1.0\ZLocation.Service.psm1:61 char:25
+ ... :Mode = if( Get-Variable IsMacOS -ErrorAction SilentlyContinue ) { 'E ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (IsMacOS:String) [Get-Variable], ItemNotFoundException
    + FullyQualifiedErrorId : VariableNotFound,Microsoft.PowerShell.Commands.GetVariableCommand

Get-Command : The term 'cde' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Program Files\WindowsPowerShell\Modules\PSFzf\1.1.23\PSFzf.Functions.ps1:11 char:15
+ ...   if (-not (Get-Command -Name $Name -ErrorAction SilentlyContinue)) { ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (cde:String) [Get-Command], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand

Get-Command : The term 'fkill' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Program Files\WindowsPowerShell\Modules\PSFzf\1.1.23\PSFzf.Functions.ps1:11 char:15
+ ...   if (-not (Get-Command -Name $Name -ErrorAction SilentlyContinue)) { ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (fkill:String) [Get-Command], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand

Get-Command : The term 'fh' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Program Files\WindowsPowerShell\Modules\PSFzf\1.1.23\PSFzf.Functions.ps1:11 char:15
+ ...   if (-not (Get-Command -Name $Name -ErrorAction SilentlyContinue)) { ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (fh:String) [Get-Command], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand

Get-Command : The term 'fasd' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Program Files\WindowsPowerShell\Modules\PSFzf\1.1.23\PSFzf.Functions.ps1:83 char:11
+ } elseif (Get-Command fasd -ErrorAction SilentlyContinue) {
+           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (fasd:String) [Get-Command], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand

Get-Command : The term 'Get-Frecents' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Program Files\WindowsPowerShell\Modules\PSFzf\1.1.23\PSFzf.Functions.ps1:68 char:5
+ if (Get-Command Get-Frecents -ErrorAction SilentlyContinue) {
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-Frecents:String) [Get-Command], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand

Get-Command : The term 'fe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Program Files\WindowsPowerShell\Modules\PSFzf\1.1.23\PSFzf.Functions.ps1:11 char:15
+ ...   if (-not (Get-Command -Name $Name -ErrorAction SilentlyContinue)) { ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (fe:String) [Get-Command], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand

So, I thought it might be a good idea to use -ErrorAction Ignore to prevent this from happening

@kelleyma49
Copy link
Owner

Fixed in https://www.powershellgallery.com/packages/PSFzf/1.1.24

@farzadmf
Copy link
Author

Great, thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants