microsoft / microsoft/winget-cli
`--log` Command Does Not Save Logs
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 26.4k
- Forks
- 1.8k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 15
Description
Brief description of your issue
Observe the following command:
winGet update --id 7zip.7zip -h --accept-package-agreements --accept-source-agreements --include-unknown --disable-interactivity --log "$env:PUBLIC\log.txt"
The documentation states that the --log option applies for both install and update commands, with the following text:
Directs the logging to a log file. You must provide a path to a file that you have the write rights to.
The command I posted does not create a log file. Why not?
In StdOut I see the following:
No available upgrade found.
No newer package versions are available from the configured sources.
But I expect to see a log file created which contains at least this information, if not the error code as well.
Steps to reproduce
Run this command:
winGet update --id 7zip.7zip -h --accept-package-agreements --accept-source-agreements --include-unknown --disable-interactivity -o "$env:PUBLIC\log.txt"
Notice how it does not make a log file in C:\Users\Public\log.txt.
Expected behaviour
A log file to be created with logging information
Actual behaviour
No log file is created
Environment
Windows PowerShell 5.1
Windows Package Manager v1.9.25200
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the documented winGet update command with --log and the issue's -o variant in Windows PowerShell 5.1. Trace the update command's log-option handling and compare it with the documented behavior. Done means the command creates the requested log file containing relevant update output, including the no-upgrade result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, powershell
- Domain
- cli, observability
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100