Moeologist / scoop-completion

scoop tab completion, work with powershell
MIT License
172 stars 12 forks source link

warning messages after updating to 0.2.0 #13

Closed ghost closed 4 years ago

ghost commented 4 years ago

this is the message that welcomes me on every new powershell window.

Get-Content : Cannot find path 'D:\scoop\shims\scoop-IsReadOnly.ps1' because it does not exist.
At D:\scoop\apps\scoop\current\lib\commands.ps1:22 char:19
+         $line = ((Get-Content $shim_path) | Where-Object { $_.startsw ...
+                   ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (D:\scoop\shims\scoop-IsReadOnly.ps1:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

Get-Content : Cannot find path 'D:\scoop\shims\scoop-IsReadOnly.ps1' because it does not exist.
At D:\scoop\apps\scoop\current\libexec\scoop-alias.ps1:91 char:20
+         $content = Get-Content (command_path $_.Name)
+                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (D:\scoop\shims\scoop-IsReadOnly.ps1:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

You cannot call a method on a null-valued expression.
At D:\scoop\apps\scoop\current\libexec\scoop-alias.ps1:92 char:9
+         $command = ($content | Select-Object -Skip 1).Trim()
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At D:\scoop\apps\scoop\current\libexec\scoop-alias.ps1:93 char:9
+         $summary = (summary $content).Trim()
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Get-Content : Cannot find path 'D:\scoop\shims\scoop-IsFixedSize.ps1' because it does not exist.
At D:\scoop\apps\scoop\current\lib\commands.ps1:22 char:19
+         $line = ((Get-Content $shim_path) | Where-Object { $_.startsw ...
+                   ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (D:\scoop\shims\scoop-IsFixedSize.ps1:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

Get-Content : Cannot find path 'D:\scoop\shims\scoop-IsFixedSize.ps1' because it does not exist.
At D:\scoop\apps\scoop\current\libexec\scoop-alias.ps1:91 char:20
+         $content = Get-Content (command_path $_.Name)
+                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (D:\scoop\shims\scoop-IsFixedSize.ps1:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

You cannot call a method on a null-valued expression.
At D:\scoop\apps\scoop\current\libexec\scoop-alias.ps1:92 char:9
+         $command = ($content | Select-Object -Skip 1).Trim()
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At D:\scoop\apps\scoop\current\libexec\scoop-alias.ps1:93 char:9
+         $summary = (summary $content).Trim()
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Get-Content : Cannot find path 'D:\scoop\shims\scoop-IsSynchronized.ps1' because it does not exist.
At D:\scoop\apps\scoop\current\lib\commands.ps1:22 char:19
+         $line = ((Get-Content $shim_path) | Where-Object { $_.startsw ...
+                   ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (D:\scoop\shims\scoop-IsSynchronized.ps1:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

Get-Content : Cannot find path 'D:\scoop\shims\scoop-IsSynchronized.ps1' because it does not exist.
At D:\scoop\apps\scoop\current\libexec\scoop-alias.ps1:91 char:20
+         $content = Get-Content (command_path $_.Name)
+                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (D:\scoop\shims\scoop-IsSynchronized.ps1:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

You cannot call a method on a null-valued expression.
At D:\scoop\apps\scoop\current\libexec\scoop-alias.ps1:92 char:9
+         $command = ($content | Select-Object -Skip 1).Trim()
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At D:\scoop\apps\scoop\current\libexec\scoop-alias.ps1:93 char:9
+         $summary = (summary $content).Trim()
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Get-Content : Cannot find path 'D:\scoop\shims\scoop-Keys.ps1' because it does not exist.
At D:\scoop\apps\scoop\current\lib\commands.ps1:22 char:19
+         $line = ((Get-Content $shim_path) | Where-Object { $_.startsw ...
+                   ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (D:\scoop\shims\scoop-Keys.ps1:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

Get-Content : Cannot find path 'D:\scoop\shims\scoop-Keys.ps1' because it does not exist.
At D:\scoop\apps\scoop\current\libexec\scoop-alias.ps1:91 char:20
+         $content = Get-Content (command_path $_.Name)
+                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (D:\scoop\shims\scoop-Keys.ps1:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

You cannot call a method on a null-valued expression.
At D:\scoop\apps\scoop\current\libexec\scoop-alias.ps1:92 char:9
+         $command = ($content | Select-Object -Skip 1).Trim()
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At D:\scoop\apps\scoop\current\libexec\scoop-alias.ps1:93 char:9
+         $summary = (summary $content).Trim()
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Get-Content : Cannot find path 'D:\scoop\shims\scoop-Values.ps1' because it does not exist.
At D:\scoop\apps\scoop\current\lib\commands.ps1:22 char:19
+         $line = ((Get-Content $shim_path) | Where-Object { $_.startsw ...
+                   ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (D:\scoop\shims\scoop-Values.ps1:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

Get-Content : Cannot find path 'D:\scoop\shims\scoop-Values.ps1' because it does not exist.
At D:\scoop\apps\scoop\current\libexec\scoop-alias.ps1:91 char:20
+         $content = Get-Content (command_path $_.Name)
+                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (D:\scoop\shims\scoop-Values.ps1:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

You cannot call a method on a null-valued expression.
At D:\scoop\apps\scoop\current\libexec\scoop-alias.ps1:92 char:9
+         $command = ($content | Select-Object -Skip 1).Trim()
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At D:\scoop\apps\scoop\current\libexec\scoop-alias.ps1:93 char:9
+         $summary = (summary $content).Trim()
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Get-Content : Cannot find path 'D:\scoop\shims\scoop-SyncRoot.ps1' because it does not exist.
At D:\scoop\apps\scoop\current\lib\commands.ps1:22 char:19
+         $line = ((Get-Content $shim_path) | Where-Object { $_.startsw ...
+                   ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (D:\scoop\shims\scoop-SyncRoot.ps1:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

Get-Content : Cannot find path 'D:\scoop\shims\scoop-SyncRoot.ps1' because it does not exist.
At D:\scoop\apps\scoop\current\libexec\scoop-alias.ps1:91 char:20
+         $content = Get-Content (command_path $_.Name)
+                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (D:\scoop\shims\scoop-SyncRoot.ps1:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

You cannot call a method on a null-valued expression.
At D:\scoop\apps\scoop\current\libexec\scoop-alias.ps1:92 char:9
+         $command = ($content | Select-Object -Skip 1).Trim()
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At D:\scoop\apps\scoop\current\libexec\scoop-alias.ps1:93 char:9
+         $summary = (summary $content).Trim()
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Get-Content : Cannot find path 'D:\scoop\shims\scoop-Count.ps1' because it does not exist.
At D:\scoop\apps\scoop\current\lib\commands.ps1:22 char:19
+         $line = ((Get-Content $shim_path) | Where-Object { $_.startsw ...
+                   ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (D:\scoop\shims\scoop-Count.ps1:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

Get-Content : Cannot find path 'D:\scoop\shims\scoop-Count.ps1' because it does not exist.
At D:\scoop\apps\scoop\current\libexec\scoop-alias.ps1:91 char:20
+         $content = Get-Content (command_path $_.Name)
+                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (D:\scoop\shims\scoop-Count.ps1:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

You cannot call a method on a null-valued expression.
At D:\scoop\apps\scoop\current\libexec\scoop-alias.ps1:92 char:9
+         $command = ($content | Select-Object -Skip 1).Trim()
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At D:\scoop\apps\scoop\current\libexec\scoop-alias.ps1:93 char:9
+         $summary = (summary $content).Trim()
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

SCOOP: D:\scoop
SCOOP_GLOBAL: D:\apps

powershell installed using scoop ->

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.2.3
PSEdition                      Core
GitCommitId                    6.2.3
OS                             Microsoft Windows 10.0.18363

contents of Microsoft.PowerShell_profile.ps1. the file is in C:\Users\John\Documents\Powershell

Import-Module "D:\scoop\modules\scoop-completion"
cd $HOME
$env:Path = "D:\scoop\apps\curl\current\bin;$env:Path"

the cd $HOME part is because otherwise powershell opens in a directiry that's not the same as Powershell 5.1


I don't know how to remove this string of messages other than adding a command in profile.

Previous version Removing older version (0.1.1) was working without any messages. version 0.2.0 also works, but why this string of red messages?


Tried to uninstall it

> scoop uninstall scoop-completion

and then install version 0.1.1 but it says

> scoop install scoop-completion@0.1.1
WARN  Given version (0.1.1) does not match manifest (0.2.0)
WARN  Attempting to generate manifest for 'scoop-completion' (0.1.1)
'scoop-completion' does not have autoupdate capability
couldn't find manifest for 'scoop-completion@0.1.1'

thanks dinNew

ghost commented 4 years ago

seems like it was because of this commit -> https://github.com/Moeologist/scoop-completion/commit/d5d379dfb05db7d1c5e2a99e5edfde85d4236df8

was it made to solve any issue? asking as I do not experience any issues, before this commit. also the new commit seems more complicated than before for doing the same thing.

on my system just use,$scoop_dir = $env:SCOOP if you want scoop directory, if the environment variable is set. maybe update this section? -> https://github.com/Moeologist/scoop-completion/blob/d5d379dfb05db7d1c5e2a99e5edfde85d4236df8/src/scoop-completion.psm1#L5-L8


thanks dinNew

Moeologist commented 4 years ago

@dinNew Sorry. I try to use scoop command's path instead of hard code in d5d379d.

I modified many other functions in v0.2.0, I can not find any hint in your warning message. It seems to be caused by 8a789201e6f0d9d09acec4f12defdfdd1d84bebf, I attempt to fix alias function, and manifest version bumped to v0.2.0 in d5d379d(changes will take effect in d5d379d).

scoop-completion old release installation was not supported.

Please run these commands and check output.

scoop alias
scoop alias list
Get-Command -ErrorAction Stop scoop
Get-Item $(Get-Command -ErrorAction Stop scoop).Path | Select-Object Directory
Neurognostic commented 4 years ago

I was having the same issue and it seemed to stem from the same issue here https://github.com/lukesampson/scoop/issues/3528.

The workaround that resolved this issue for me was to execute:

scoop config alias @{}
slickag commented 4 years ago

I was having the same issue and it seemed to stem from the same issue here lukesampson/scoop#3528.

The workaround that resolved this issue for me was to execute:

scoop config alias @{}

This fixed it for me as well just now, thanks! :)

Moeologist commented 4 years ago

It was caused by a scoop bug, README.md has been updated.