microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
23.29k stars 1.45k forks source link

winget export with relative paths does not work #1922

Open digit4lhaze opened 2 years ago

digit4lhaze commented 2 years ago

Brief description of your issue

"winget export -o ~/desktop/installedpackages.json" does not create a file while

"winget export -o C:\Users\$InsertUsernameHere\Desktop\installedpackages.json" does work

It would be nice if that would be fixed to make scripts easier

Thanks

Steps to reproduce

winget export -o ~/desktop/installedpackages.json

Expected behavior

Creates export file in relative path sucessfully

Actual behavior

the process runs as normal but creates no export file

Environment

winget --info

Windows.Desktop v10.0.19044.1466
Microsoft.DesktopAppInstaller v1.16.13405.0

winget --version

v1.1.13405
Trenly commented 2 years ago

winget export ../desktop/Folder/export.json worked for me

digit4lhaze commented 2 years ago

winget export ../desktop/Folder/export.json

That works for me too thx! But Im still wondering why "winget export -o ~/desktop/installedpackages.json" does not work...

It should also work with "~" right?

ItzLevvie commented 2 years ago

It's .. for Windows and ~ for Unix/Linux distributions.

digit4lhaze commented 2 years ago

It's .. for Windows and ~ for Unix/Linux distributions.

Ok sorry then for the noob question...

I tried "cd ~/desktop" in powershell and it worked... So I thought it should also work for this tool...

denelon commented 2 years ago

I converted this "bug" into a "Feature". We may be able to make this work. I'm all about not having to "fight" muscle memory. We will have to take a look and consider any implications with how this might create problems elsewhere, but it might help reduce friction.

ItzLevvie commented 2 years ago

I tried "cd ~/desktop" in powershell and it worked... So I thought it should also work for this tool...

Ah, I thought you were running it in Command Prompt.

Trenly commented 1 year ago

[Policy] Command-Export