Giter Site home page Giter Site logo

scoop-completion's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

scoop-completion's Issues

load module error

versions

powershell core 7.0.0-rc1 and powershell 5.1
scoop-completion 0.2.2 installed via Ash258 bucket

error

i import this module in my $PROFILE, everytime i open powershell, it will appear the errors as follow:

Get-Content: C:\soft\Scoop\apps\scoop\current\lib\commands.ps1
Line |
  22 |         $line = ((Get-Content $shim_path) | Where-Object { $_.startswith('$path') })
     |                   ^ Cannot find path 'C:\soft\Scoop\shims\scoop-IsReadOnly.ps1'        | because it does not exist.

Get-Content: C:\soft\Scoop\apps\scoop\current\libexec\scoop-alias.ps1
Line |
  91 |         $content = Get-Content (command_path $_.Name)
     |                    ^ Cannot find path 'C:\soft\Scoop\shims\scoop-IsReadOnly.ps1'
     | because it does not exist.

InvalidOperation: C:\soft\Scoop\apps\scoop\current\libexec\scoop-alias.ps1
Line |
  92 |         $command = ($content | Select-Object -Skip 1).Trim()
     |         ^ You cannot call a method on a null-valued expression.

InvalidOperation: C:\soft\Scoop\apps\scoop\current\libexec\scoop-alias.ps1
Line |
  93 |         $summary = (summary $content).Trim()
     |         ^ You cannot call a method on a null-valued expression.

Get-Content: C:\soft\Scoop\apps\scoop\current\lib\commands.ps1
Line |
  22 |         $line = ((Get-Content $shim_path) | Where-Object { $_.startswith('$path') })
     |                   ^ Cannot find path 'C:\soft\Scoop\shims\scoop-IsFixedSize.ps1'       | because it does not exist.

Get-Content: C:\soft\Scoop\apps\scoop\current\libexec\scoop-alias.ps1
Line |
  91 |         $content = Get-Content (command_path $_.Name)
     |                    ^ Cannot find path 'C:\soft\Scoop\shims\scoop-IsFixedSize.ps1'      | because it does not exist.

InvalidOperation: C:\soft\Scoop\apps\scoop\current\libexec\scoop-alias.ps1
Line |
  92 |         $command = ($content | Select-Object -Skip 1).Trim()
     |         ^ You cannot call a method on a null-valued expression.

InvalidOperation: C:\soft\Scoop\apps\scoop\current\libexec\scoop-alias.ps1
Line |
  93 |         $summary = (summary $content).Trim()
     |         ^ You cannot call a method on a null-valued expression.

Get-Content: C:\soft\Scoop\apps\scoop\current\lib\commands.ps1
Line |
  22 |         $line = ((Get-Content $shim_path) | Where-Object { $_.startswith('$path') })
     |                   ^ Cannot find path
     | 'C:\soft\Scoop\shims\scoop-IsSynchronized.ps1' because it does not exist.

Get-Content: C:\soft\Scoop\apps\scoop\current\libexec\scoop-alias.ps1
Line |
  91 |         $content = Get-Content (command_path $_.Name)
     |                    ^ Cannot find path
     | 'C:\soft\Scoop\shims\scoop-IsSynchronized.ps1' because it does not exist.

InvalidOperation: C:\soft\Scoop\apps\scoop\current\libexec\scoop-alias.ps1
Line |
  92 |         $command = ($content | Select-Object -Skip 1).Trim()
     |         ^ You cannot call a method on a null-valued expression.

InvalidOperation: C:\soft\Scoop\apps\scoop\current\libexec\scoop-alias.ps1
Line |
  93 |         $summary = (summary $content).Trim()
     |         ^ You cannot call a method on a null-valued expression.

Get-Content: C:\soft\Scoop\apps\scoop\current\lib\commands.ps1
Line |
  22 |         $line = ((Get-Content $shim_path) | Where-Object { $_.startswith('$path') })
     |                   ^ Cannot find path 'C:\soft\Scoop\shims\scoop-Keys.ps1' because      | it does not exist.

Get-Content: C:\soft\Scoop\apps\scoop\current\libexec\scoop-alias.ps1
Line |
  91 |         $content = Get-Content (command_path $_.Name)
     |                    ^ Cannot find path 'C:\soft\Scoop\shims\scoop-Keys.ps1'             | because it does not exist.

InvalidOperation: C:\soft\Scoop\apps\scoop\current\libexec\scoop-alias.ps1
Line |
  92 |         $command = ($content | Select-Object -Skip 1).Trim()
     |         ^ You cannot call a method on a null-valued expression.

InvalidOperation: C:\soft\Scoop\apps\scoop\current\libexec\scoop-alias.ps1
Line |
  93 |         $summary = (summary $content).Trim()
     |         ^ You cannot call a method on a null-valued expression.

Get-Content: C:\soft\Scoop\apps\scoop\current\lib\commands.ps1
Line |
  22 |         $line = ((Get-Content $shim_path) | Where-Object { $_.startswith('$path') })
     |                   ^ Cannot find path 'C:\soft\Scoop\shims\scoop-Values.ps1'            | because it does not exist.

Get-Content: C:\soft\Scoop\apps\scoop\current\libexec\scoop-alias.ps1
Line |
  91 |         $content = Get-Content (command_path $_.Name)
     |                    ^ Cannot find path 'C:\soft\Scoop\shims\scoop-Values.ps1'           | because it does not exist.

InvalidOperation: C:\soft\Scoop\apps\scoop\current\libexec\scoop-alias.ps1
Line |
  92 |         $command = ($content | Select-Object -Skip 1).Trim()
     |         ^ You cannot call a method on a null-valued expression.

InvalidOperation: C:\soft\Scoop\apps\scoop\current\libexec\scoop-alias.ps1
Line |
  93 |         $summary = (summary $content).Trim()
     |         ^ You cannot call a method on a null-valued expression.

Get-Content: C:\soft\Scoop\apps\scoop\current\lib\commands.ps1
Line |
  22 |         $line = ((Get-Content $shim_path) | Where-Object { $_.startswith('$path') })
     |                   ^ Cannot find path 'C:\soft\Scoop\shims\scoop-SyncRoot.ps1'          | because it does not exist.

Get-Content: C:\soft\Scoop\apps\scoop\current\libexec\scoop-alias.ps1
Line |
  91 |         $content = Get-Content (command_path $_.Name)
     |                    ^ Cannot find path 'C:\soft\Scoop\shims\scoop-SyncRoot.ps1'         | because it does not exist.

InvalidOperation: C:\soft\Scoop\apps\scoop\current\libexec\scoop-alias.ps1
Line |
  92 |         $command = ($content | Select-Object -Skip 1).Trim()
     |         ^ You cannot call a method on a null-valued expression.

InvalidOperation: C:\soft\Scoop\apps\scoop\current\libexec\scoop-alias.ps1
Line |
  93 |         $summary = (summary $content).Trim()
     |         ^ You cannot call a method on a null-valued expression.

Get-Content: C:\soft\Scoop\apps\scoop\current\lib\commands.ps1
Line |
  22 |         $line = ((Get-Content $shim_path) | Where-Object { $_.startswith('$path') })
     |                   ^ Cannot find path 'C:\soft\Scoop\shims\scoop-Count.ps1'
     | because it does not exist.

Get-Content: C:\soft\Scoop\apps\scoop\current\libexec\scoop-alias.ps1
Line |
  91 |         $content = Get-Content (command_path $_.Name)
     |                    ^ Cannot find path 'C:\soft\Scoop\shims\scoop-Count.ps1'            | because it does not exist.

InvalidOperation: C:\soft\Scoop\apps\scoop\current\libexec\scoop-alias.ps1
Line |
  92 |         $command = ($content | Select-Object -Skip 1).Trim()
     |         ^ You cannot call a method on a null-valued expression.

InvalidOperation: C:\soft\Scoop\apps\scoop\current\libexec\scoop-alias.ps1
Line |
  93 |         $summary = (summary $content).Trim()
     |         ^ You cannot call a method on a null-valued expression.

autocompletion for aliases

Is it possible to support aliases in scoop? - It would be very convenient!

Usage:

> scoop alias add rm 'scoop uninstall @args'
> scoop rm <tab>

My computer didn't have the path and file “C:\Users\younger\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1”

All the things are right at first

PS C:\Users\younger> $env:SCOOP
C:\Users\younger\scoop
PS C:\Users\younger> $env:USERPROFILE
C:\Users\younger
PS C:\Users\younger> Import-Module "$env:SCOOP/modules/scoop-completion"

For enable completion in current shell it works

but it fails to enable auto-load

PS C:\Users\younger> Add-Content -Path $Profile -Value "`nImport-Module `"$env:SCOOP/modules/scoop-completion`""
Add-Content : 未能找到路径“C:\Users\younger\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1”的一部分。
所在位置 行:1 字符: 1
+ Add-Content -Path $Profile -Value "`nImport-Module `"$env:SCOOP/modul ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\younge...ell_profile.ps1:String) [Add-Content], DirectoryNotF
   oundException
    + FullyQualifiedErrorId : GetContentWriterDirectoryNotFoundError,Microsoft.PowerShell.Commands.AddContentCommand

I didn't find the path and the file in my computer,so I think it may be PowerShell' config, but I don't know why

warning messages after updating to 0.2.0

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 [email protected]
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 '[email protected]'

thanks dinNew

pwsh: PSConsoleReadLine threw an exception

pwsh: 6.1.0

Set-PSReadlineKeyHandler : The type initializer for 'Microsoft.PowerShell.PSConsoleReadLine' threw an exception.
At S:\Scoop\apps\scoop-auto-completion\current\scoop-completion.ps1:249 char:1
+ Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Set-PSReadLineKeyHandler], TypeInitializationException
+ FullyQualifiedErrorId : System.TypeInitializationException,Microsoft.PowerShell.SetPSReadLineKeyHandlerCommand

message about Set-PSReadlineKeyHandler in Powershell 5.1

Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete

in powershell 5.1, on Windows 10 1903, scoop-completion works, but the PSReadline module is not installed for powershell 5.1.

open powershell 5.1 and type the below command.

> Get-Module

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Manifest   3.1.0.0    Microsoft.PowerShell.Management     {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Con...
Manifest   3.1.0.0    Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable, Compare-Object...}

then import-module path-to/scoop-completion gives ->

Set-PSReadlineKeyHandler : The term 'Set-PSReadlineKeyHandler' 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 D:\scoop\modules\scoop-completion\scoop-completion.psm1:270 char:1
+ Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Set-PSReadlineKeyHandler:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

this issue has always been there in scop-completion since version 0.0.4 ; and then run this command ->

> Get-Module

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Manifest   3.1.0.0    Microsoft.PowerShell.Management     {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Con...
Manifest   3.1.0.0    Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable, Compare-Object...}
Script     0.1.0      scoop-completion                    TabExpansion


regards ratatoeey

Why is installation from PSGallery deprecated?

The readme says that installing via PSGallery is deprecated. Why?
I am at the moment creating a meta module for all PS module that offer tab completion help and consider adding scoop-completion. My bootstrapper is entirely based on the PSGallery and I don't want to maintain custom commands for installing each module, hence my question.

Suggestion: support completion with sudo

Currently if the scoop command is prefixed with the sudo command, the completion breaks.
I wonder if it would be possible to modify completion so that sudo scoop would work.

ERROR Hash check failed!

PS > scoop install scoop-completion
Installing 'scoop-completion' (0.2.0) [64bit]
Loading scoop-completion.psm1 from cache.
Loading scoop-completion.psd1 from cache.
Checking hash of scoop-completion.psm1 ... ERROR Hash check failed!
App:         scoop-completion/scoop-completion
URL:         https://raw.githubusercontent.com/Moeologist/scoop-completion/v0.2.0/src/scoop-completion.psm1
First bytes: 23 20 54 68 69 73 20 73
Expected:    e6291bd1978a8bf2e9219f0db6710a6ab925f0ddc3d20bc0dd641194b6a26842
Actual:      48abaaf30797c8b329e7b00b0bf700a177cebf1296dd7aa5690addfb6ea36089

Please try again or create a new issue by using the following link and paste your console output:
https://github.com/Moeologist/scoop-completion/issues/new?title=scoop-completion%400.2.0%3a+hash+check+failed

Hash needs update.

Optimalization

While uninstalling Get-ChildItem could be used instead of scoop list filtering:

https://github.com/liuzijing97/scoop-auto-completion/blob/59df29f2dfb404cdc60dc2c52c070f8ec3a21a8a/scoop-completion.ps1#L84-L90

$timeB = Measure-Command { Get-ChildItem "$env:SCOOP\apps" }
$timeB


Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 0
Milliseconds      : 8
Ticks             : 80021
TotalDays         : 9.26168981481481E-08
TotalHours        : 2.22280555555556E-06
TotalMinutes      : 0.000133368333333333
TotalSeconds      : 0.0080021
TotalMilliseconds : 8.0021

vs

$timeA = Measure-Command {@(& scoop list 6>&1 |
 Where-Object { $_ -match '^\s*([\w][\-\.\w]*) $' } |
 ForEach-Object { $_ -replace '^\s*([\w][\-\.\w]*) $', '$1' } |
 Where-Object { $_ -like "$filter*" }
)}
$timeA


Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 0
Milliseconds      : 352
Ticks             : 3522911
TotalDays         : 4.07744328703704E-06
TotalHours        : 9.78586388888889E-05
TotalMinutes      : 0.00587151833333333
TotalSeconds      : 0.3522911
TotalMilliseconds : 352.2911

Installation method for powershell and pwsh differ

The listed methods for installing in (windows) powershell and (core) pwsh differ and produce errors when used by each other.

If we share the PowerShell_profile.ps1 file for both versions this is an issue.

Can replace both methods with the following code which works either way, and doesn't produce any errors in either version:

# enable auto-load, create profile if not exist
$env:SCOOP = "$env:USERPROFILE\scoop"; Add-Content -Path $Profile -Value "`nImport-Module $env:SCOOP/modules/scoop-completion"

Autocomplete of aliases fail with name containes dash ('-')

I noticed that some aliases are auto-completed while others where not, and the difference was those that were not had dashes in them.
I then tested a few other special characters, and it seems that numbers and underscore are ok, the rest are not.

Would it be possible to add support for dashes?


Code I used to test:

# https://github.com/lukesampson/scoop/issues/3528#issuecomment-508120749
try { scoop config alias | Out-Null } catch { scoop config alias @{} }

# define some utility aliases for clarity of code
$(scoop alias rm aliaslist *>&1) | Out-Null
$(scoop alias rm autocomplete-on *>&1) | Out-Null
$(scoop alias rm autocomplete-off *>&1) | Out-Null
scoop alias add aliaslist 'scoop config alias | Out-String -Stream | Where-Object { $_ } | Select-Object @{N="Alias";E={($_ -split ":")[0].Trim()}},@{N="Src";E={($_ -split ":")[1].Trim()}}'
scoop alias add autocomplete-on 'Get-Module -ListAvailable $env:SCOOP\modules\* | Where-Object Name -eq scoop-completion | Import-Module'
scoop alias add autocomplete-off 'Get-Module scoop-completion | Remove-Module'

# remove any previously existing test aliases
# scoop aliaslist | Where-Object Alias -like 'test*' | ForEach-Object { $(scoop alias rm $_.Alias *>&1) | Out-Null }

# Add test aliases
scoop alias add test_one   "echo test_one"
scoop alias add test2me    "echo test2me"
scoop alias add test3      "echo test3"
scoop alias add testFour   "echo testFour"

scoop alias add test-five  "echo test-five"

scoop alias add test=six "echo test=six"
scoop alias add 'test@seven' "echo test@seven"
scoop alias add 'test#eight' "echo test#eight"

# Toggle autocomplete - so that alias cached list will reload
scoop autocomplete-off
scoop autocomplete-on 

# List all test* aliases
scoop aliaslist | Where-Object Alias -like 'test*'

Auto complete worked for the following

scoop test<tab>:

test_one
test2me
test3
testFour

The following did not auto-complete:

test-five
test=six
test@seven
test#eight

Missing hash

Would it be possible for you to include the file hash for master.zip in the manifest?

lazy load completions

Currently loading profiles took 663ms on my computer.

Lazy load the ScoopAliasMap dictionary can avoid unnecessary call.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.