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

Output can't be used with Powershell #196

Closed
mikemaccana opened this issue May 19, 2020 · 9 comments
Closed

Output can't be used with Powershell #196

mikemaccana opened this issue May 19, 2020 · 9 comments
Milestone

Comments

@mikemaccana
Copy link

mikemaccana commented May 19, 2020

Brief description of your issue

winget.exe show | select 'Name'

Returns blank results. It looks like the output for winget isn't consistent with Powershell, which is the default shell in Windows.

Expected behavior

I should be able to start powershell via Win X and use winget.

Actual behavior

winget outputs unstructured data.

Environment

Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19613.1005
Package: Microsoft.DesktopAppInstaller v1.0.41331.0

Links:
  Privacy Statement: https://aka.ms/winget-privacy
  License agreement: https://aka.ms/winget-license
  3rd Party Notices: https://aka.ms/winget-3rdPartyNotice
  Homepage:          https://aka.ms/winget
@jantari
Copy link

jantari commented May 19, 2020

That is to be expected and cannot be solved.

I think what you're really asking for is perhaps a -j switch (or similar) that causes winget to output structured data in JSON etc. then you can winget.exe show -j | convertfrom-json | select name

@mikemaccana
Copy link
Author

mikemaccana commented May 19, 2020 via email

@AspenForester
Copy link

Rolling out a new tool in 2020 as an exe instead of, or at least, without a set of native PowerShell Commands seems, well, surprising. But I also feel like this happened with Project Honolulu, too, where the project team completely missed the desires of the target audience on the first release.

@ThomasNieto
Copy link

Created #221 for native PowerShell cmdlets.

@KevinMarquette
Copy link

Definitely provide json output support. I'm done with parsing standard output.

@denelon
Copy link
Contributor

denelon commented May 23, 2020

It looks like Issue #184 covers JSON output.

@denelon
Copy link
Contributor

denelon commented May 23, 2020

It looks like two features were created to address this concern. @mikemaccana if you believe they don't address this Issue please create a new one. #184 #221

@denelon denelon closed this as completed May 23, 2020
@mikemaccana
Copy link
Author

mikemaccana commented May 23, 2020

#184 and #221 doesn't address the concern as windows commands should output structured data by default. winget.exe show | select 'Name' won't work. It should work.

@denelon: powershell is the default terminal for windows. winget should support Windows defaults, and not need extra winget-specific steps like outputting a different format and then converting from it.

Additionally - and it feels odd having to say this to a Microsoft employee - outputting native powershell would allow people who want CSV, JSON, Excel or any other format to be supported, allow us to format the output how we want, or do all the normal things one can do with a modern Windows command line app

@denelon: if the winget team doesn't want to support Windows' standard shell, then why?

@jantari
Copy link

jantari commented May 23, 2020

@denelon: if the winget team doesn't want to support Windows' standard shell, then why?

One possible reason is that PowerShell is not in WinPE (by default) and also not in Windows Server Nano. It would be nice for a package manager to work on Windows Nano.

Also, PowerShell cmdlets must be written in PowerShell or C#. They are going to be slower than this app, which is native C++.

But that is only a guess, I don't know their reasons. I know there's a place for non-PowerShell cli-tools on Windows, but I feel as though there needs to be a special DOCUMENTED section explaining why any given new tooling is NOT PowerShell based. Otherwise we're just going to end up with a mess.

@denelon denelon added this to the v1.3-Client milestone Jun 21, 2022
yao-msft added a commit to yao-msft/winget-cli that referenced this issue May 30, 2024
ff315ecf User/xiangweiniu/fix missing tab (microsoft#196)
da601af9 Bumping version to 1.0.0 (microsoft#195)

git-subtree-dir: src/SfsClient/sfs-client
git-subtree-split: ff315ecfa2ef2953d8a808e51e8a61a4e0759180
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

6 participants