You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the aliases property of config.json is empty, the command scoop alias list throws a ton of errors.
Expected Behavior
It should show no output at all.
Additional context/output
Click to see stacktrace
~ in [pwsh] at •100% 23:45:23
❯ scoop alias list
Get-Content: C:\Users\username\scoop\apps\scoop\current\lib\commands.ps1:22
Line |
22 | $line = ((Get-Content $shim_path) | Where-Object { $_.startsw …
| ~~~~~~~~~~~~~~~~~~~~~~
| Cannot find path 'C:\Users\username\scoop\shims\scoop-IsReadOnly.ps1' because it does not exist.
Get-Content: C:\Users\username\scoop\apps\scoop\current\libexec\scoop-alias.ps1:91
Line |
91 | $content = Get-Content (command_path $_.Name)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot find path 'C:\Users\username\scoop\shims\scoop-IsReadOnly.ps1' because it does not exist.
InvalidOperation: C:\Users\username\scoop\apps\scoop\current\libexec\scoop-alias.ps1:92
Line |
92 | $command = ($content | Select-Object -Skip 1).Trim()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
InvalidOperation: C:\Users\username\scoop\apps\scoop\current\libexec\scoop-alias.ps1:93
Line |
93 | $summary = (summary $content).Trim()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
Get-Content: C:\Users\username\scoop\apps\scoop\current\lib\commands.ps1:22
Line |
22 | $line = ((Get-Content $shim_path) | Where-Object { $_.startsw …
| ~~~~~~~~~~~~~~~~~~~~~~
| Cannot find path 'C:\Users\username\scoop\shims\scoop-IsFixedSize.ps1' because it does not exist.
Get-Content: C:\Users\username\scoop\apps\scoop\current\libexec\scoop-alias.ps1:91
Line |
91 | $content = Get-Content (command_path $_.Name)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot find path 'C:\Users\username\scoop\shims\scoop-IsFixedSize.ps1' because it does not exist.
InvalidOperation: C:\Users\username\scoop\apps\scoop\current\libexec\scoop-alias.ps1:92
Line |
92 | $command = ($content | Select-Object -Skip 1).Trim()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
InvalidOperation: C:\Users\username\scoop\apps\scoop\current\libexec\scoop-alias.ps1:93
Line |
93 | $summary = (summary $content).Trim()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
Get-Content: C:\Users\username\scoop\apps\scoop\current\lib\commands.ps1:22
Line |
22 | $line = ((Get-Content $shim_path) | Where-Object { $_.startsw …
| ~~~~~~~~~~~~~~~~~~~~~~
| Cannot find path 'C:\Users\username\scoop\shims\scoop-IsSynchronized.ps1' because it does not
| exist.
Get-Content: C:\Users\username\scoop\apps\scoop\current\libexec\scoop-alias.ps1:91
Line |
91 | $content = Get-Content (command_path $_.Name)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot find path 'C:\Users\username\scoop\shims\scoop-IsSynchronized.ps1' because it does not
| exist.
InvalidOperation: C:\Users\username\scoop\apps\scoop\current\libexec\scoop-alias.ps1:92
Line |
92 | $command = ($content | Select-Object -Skip 1).Trim()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
InvalidOperation: C:\Users\username\scoop\apps\scoop\current\libexec\scoop-alias.ps1:93
Line |
93 | $summary = (summary $content).Trim()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
Get-Content: C:\Users\username\scoop\apps\scoop\current\lib\commands.ps1:22
Line |
22 | $line = ((Get-Content $shim_path) | Where-Object { $_.startsw …
| ~~~~~~~~~~~~~~~~~~~~~~
| Cannot find path 'C:\Users\username\scoop\shims\scoop-Keys.ps1' because it does not exist.
Get-Content: C:\Users\username\scoop\apps\scoop\current\libexec\scoop-alias.ps1:91
Line |
91 | $content = Get-Content (command_path $_.Name)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot find path 'C:\Users\username\scoop\shims\scoop-Keys.ps1' because it does not exist.
InvalidOperation: C:\Users\username\scoop\apps\scoop\current\libexec\scoop-alias.ps1:92
Line |
92 | $command = ($content | Select-Object -Skip 1).Trim()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
InvalidOperation: C:\Users\username\scoop\apps\scoop\current\libexec\scoop-alias.ps1:93
Line |
93 | $summary = (summary $content).Trim()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
Get-Content: C:\Users\username\scoop\apps\scoop\current\lib\commands.ps1:22
Line |
22 | $line = ((Get-Content $shim_path) | Where-Object { $_.startsw …
| ~~~~~~~~~~~~~~~~~~~~~~
| Cannot find path 'C:\Users\username\scoop\shims\scoop-Values.ps1' because it does not exist.
Get-Content: C:\Users\username\scoop\apps\scoop\current\libexec\scoop-alias.ps1:91
Line |
91 | $content = Get-Content (command_path $_.Name)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot find path 'C:\Users\username\scoop\shims\scoop-Values.ps1' because it does not exist.
InvalidOperation: C:\Users\username\scoop\apps\scoop\current\libexec\scoop-alias.ps1:92
Line |
92 | $command = ($content | Select-Object -Skip 1).Trim()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
InvalidOperation: C:\Users\username\scoop\apps\scoop\current\libexec\scoop-alias.ps1:93
Line |
93 | $summary = (summary $content).Trim()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
Get-Content: C:\Users\username\scoop\apps\scoop\current\lib\commands.ps1:22
Line |
22 | $line = ((Get-Content $shim_path) | Where-Object { $_.startsw …
| ~~~~~~~~~~~~~~~~~~~~~~
| Cannot find path 'C:\Users\username\scoop\shims\scoop-SyncRoot.ps1' because it does not exist.
Get-Content: C:\Users\username\scoop\apps\scoop\current\libexec\scoop-alias.ps1:91
Line |
91 | $content = Get-Content (command_path $_.Name)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot find path 'C:\Users\username\scoop\shims\scoop-SyncRoot.ps1' because it does not exist.
InvalidOperation: C:\Users\username\scoop\apps\scoop\current\libexec\scoop-alias.ps1:92
Line |
92 | $command = ($content | Select-Object -Skip 1).Trim()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
InvalidOperation: C:\Users\username\scoop\apps\scoop\current\libexec\scoop-alias.ps1:93
Line |
93 | $summary = (summary $content).Trim()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
Get-Content: C:\Users\username\scoop\apps\scoop\current\lib\commands.ps1:22
Line |
22 | $line = ((Get-Content $shim_path) | Where-Object { $_.startsw …
| ~~~~~~~~~~~~~~~~~~~~~~
| Cannot find path 'C:\Users\username\scoop\shims\scoop-Count.ps1' because it does not exist.
Get-Content: C:\Users\username\scoop\apps\scoop\current\libexec\scoop-alias.ps1:91
Line |
91 | $content = Get-Content (command_path $_.Name)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot find path 'C:\Users\username\scoop\shims\scoop-Count.ps1' because it does not exist.
InvalidOperation: C:\Users\username\scoop\apps\scoop\current\libexec\scoop-alias.ps1:92
Line |
92 | $command = ($content | Select-Object -Skip 1).Trim()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
InvalidOperation: C:\Users\username\scoop\apps\scoop\current\libexec\scoop-alias.ps1:93
Line |
93 | $summary = (summary $content).Trim()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
The aliases it's looking for are the properties of a PowerShell object itself. Can be remedied by properly checking if aliases filed exists in the config.json file.
Bug Report
Current Behavior
When the aliases property of config.json is empty, the command
scoop alias list
throws a ton of errors.Expected Behavior
It should show no output at all.
Additional context/output
Click to see stacktrace
Possible Solution
The aliases it's looking for are the properties of a PowerShell object itself. Can be remedied by properly checking if
aliases
filed exists in the config.json file.System details
Windows version: 10
OS architecture: 64bit
PowerShell version: Both 5.1 and 7.2.0
Additional software: None
Scoop Configuration
The text was updated successfully, but these errors were encountered: