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

Scoop-Search does not return powershell objects like the original command #67

Open
Alfamari opened this issue Sep 20, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Alfamari
Copy link

Description

Following the instructions of: Behaves just like scoop search and returns identical output. If any differences are found please open an issue.

Apart from being visually different, it also loses its ability for powershell object filtering/manipulation.

wezterm-gui_401m3xovq8

wezterm-gui_3WISRJT350

Logs

The offending command causing the error with the $env:SCOOP_SEARCH_VERBOSE=1 env var set:

Output
env:SCOOP=
env:USERPROFILE=C:\Users\alfamari
env:XDG_CONFIG_HOME=
Scoop config file path: C:\Users\alfamari/.config/scoop/config.json
Scoop config file contents: {
  "last_update": "2024-09-20T01:04:17.4222547-05:00",
  "scoop_repo": "https://github.com/ScoopInstaller/Scoop",
  "scoop_branch": "master",
  "root_path": "D:\\Program Files (x86)\\Scoop",
  "global_path": "D:\\Program Files (x86)\\Scoop",
  "aria2-enabled": true
}

Scoop home: D:\Program Files (x86)\Scoop
Found bucket: D:\Program Files (x86)\Scoop/buckets/extras
Worker count: 8
Found 5 matches
Found bucket: D:\Program Files (x86)\Scoop/buckets/main
Worker count: 8
Found 2 matches
Done searching
'extras' bucket:
    anaconda3 (2024.06-1) --> includes 'python.exe'
    fontforge (20230101) --> includes 'ffpython.exe'
    mambaforge (24.7.1-0) --> includes 'python.exe'
    miniconda3 (24.7.1-0) --> includes 'python.exe'
    paraview (5.13.0) --> includes 'pvpython.exe'

'main' bucket:
    python (3.12.6)
    winpython (3.12.4.1)
@Alfamari Alfamari added the bug Something isn't working label Sep 20, 2024
@Alfamari
Copy link
Author

Additionally the output for returning no results is very slightly different. (Honestly, doesn't really seem noteworthy but I thought I'd document the difference and leave it up to the developer.)

wezterm-gui_1AzxlzLxHY

@shilangyu
Copy link
Owner

In the past, scoop would also output pure strings and not powershell objects. At some point I tried to see how a non-powershell program can output powershell objects, but I did not find the solution. Does anyone know how this is done?

@Alfamari
Copy link
Author

Well if it can output into a structured format, powershell does have ways of converting raw strings into objects:

Easiest method using standardized formats:
ConvertFrom-Json (Microsoft.PowerShell.Utility) - PowerShell | Microsoft Learn
ConvertFrom-Csv (Microsoft.PowerShell.Utility) - PowerShell | Microsoft Learn

Can utilize customized non-standardized structured formats but much more annoying:
ConvertFrom-String (Microsoft.PowerShell.Utility) - PowerShell | Microsoft Learn
ConvertFrom-StringData (Microsoft.PowerShell.Utility) - PowerShell | Microsoft Learn

@shilangyu
Copy link
Owner

I don't think that would be wanted though. If this were to be implemented I think it should directly output powershell objects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants