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

Add new subcommand "scoop diag" #5543

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
Open

Add new subcommand "scoop diag" #5543

wants to merge 11 commits into from

Conversation

r15ch13
Copy link
Member

@r15ch13 r15ch13 commented Jun 16, 2023

Description

This introduces the new subcommand scoop diag.
It returns information about the Scoop environment using the Ini file format that can be posted on a GitHub issue (including markdown codeblock).
Sensitive content and the username gets automatically redacted.

Is there any other information that could be added to this (or redacted)?

Example output if run from inside Visual Studio Code `.\bin\scoop.ps1 diag`

[PowerShell]
Path         = %USERPROFILE%\scoop\apps\pwsh\current\pwsh.exe
Version      = 7.3.4
Edition      = Core
Architecture = 64bit
RunAsAdmin   = False
Parent       = Code.exe
[Helpers]
GitPath      = %USERPROFILE%\scoop\apps\git\current\mingw64\bin\git.exe
GitVersion   = git version 2.41.0.windows.1
Zip          = True
Lessmsi      = True
Innounp      = True
Dark         = True
Aria2        = True
Zstd         = False
[Environment]
HTTPS_PROXY  = <redacted>
HTTP_PROXY   = <redacted>
[Scoop]
Outdated     = True
OnHold       = False
Config       = %USERPROFILE%\.config\scoop\config.json
CoreRoot     = X:\~projects\~powershell\scoop
ScoopDir     = %USERPROFILE%\scoop
CacheDir     = %USERPROFILE%\scoop\cache
GlobalDir    = C:\ProgramData\scoop
[Config]
debug        = True
last_update  = 06/12/2023 20:47:17
gh_token     = <redacted>
virustotal_api_key = <redacted>
aria2-warning-enabled = False
scoop_branch = develop
scoop_repo   = https://github.com/ScoopInstaller/Scoop

Example from my actual scoop installation

[PowerShell]
Path         = %USERPROFILE%\scoop\apps\pwsh\current\pwsh.exe
Version      = 7.3.4
Edition      = Core
Architecture = 64bit
RunAsAdmin   = False
Parent       = WindowsTerminal.exe
[Helpers]
GitPath      = %USERPROFILE%\scoop\apps\git\current\mingw64\bin\git.exe
GitVersion   = git version 2.41.0.windows.1
Zip          = True
Lessmsi      = True
Innounp      = True
Dark         = True
Aria2        = True
Zstd         = False
[Environment]
[Scoop]
Outdated     = True
OnHold       = False
Config       = %USERPROFILE%\.config\scoop\config.json
CoreRoot     = %USERPROFILE%\scoop\apps\scoop\current
ScoopDir     = %USERPROFILE%\scoop
CacheDir     = %USERPROFILE%\scoop\cache
GlobalDir    = C:\ProgramData\scoop
[Config]
debug        = True
last_update  = 06/12/2023 20:47:17
analytics_id = <redacted>
aria2-warning-enabled = False
scoop_branch = develop
scoop_repo   = https://github.com/ScoopInstaller/Scoop

Example from PowerShell 5

[PowerShell]
Path         = C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Version      = 5.1.22621.963
Edition      = Desktop
Architecture = 64bit
RunAsAdmin   = False
[Helpers]
GitPath      = %USERPROFILE%\scoop\apps\git\current\mingw64\bin\git.exe
GitVersion   = git version 2.41.0.windows.1
Zip          = True
Lessmsi      = True
Innounp      = True
Dark         = True
Aria2        = True
Zstd         = False
[Environment]
[Scoop]
Outdated     = True
OnHold       = False
Config       = %USERPROFILE%\.config\scoop\config.json
CoreRoot     = %USERPROFILE%\scoop\apps\scoop\current
ScoopDir     = %USERPROFILE%\scoop
CacheDir     = %USERPROFILE%\scoop\cache
GlobalDir    = C:\ProgramData\scoop
[Config]
debug        = True
last_update  = 2023-06-12T20:47:17.5893619+02:00
analytics_id = <redacted>
aria2-warning-enabled = False
scoop_branch = develop
scoop_repo   = https://github.com/ScoopInstaller/Scoop

Motivation and Context

Get more information from users about the system setup when they are opening issues.

Checklist:

  • I have read the Contributing Guide.
  • I have ensured that I am targeting the develop branch.
  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.
  • I have added an entry in the CHANGELOG.

@r15ch13 r15ch13 changed the base branch from master to develop June 16, 2023 17:56
Returns information about the Scoop environment that can be posted on a GitHub issue
@HUMORCE
Copy link
Member

HUMORCE commented Jun 18, 2023

Developer mode and other missing entries in scoop checkup should be added also, IMO.

@HUMORCE
Copy link
Member

HUMORCE commented Jun 19, 2023

Consider add it as a subcommand of scoop-checkup(scoop checkup diag), or a verbose/special output.(scoop checkup --verbose|diag...)

@r15ch13
Copy link
Member Author

r15ch13 commented Oct 9, 2023

image

[PowerShell]
Path         = $env:USERPROFILE\scoop\apps\pwsh\current\pwsh.exe
Version      = 7.3.7
Edition      = Core
Architecture = 64bit
RunAsAdmin   = False
Parent       = Code.exe
[Helpers]
GitPath      = $env:USERPROFILE\scoop\apps\git\current\mingw64\bin\git.exe
GitVersion   = git version 2.42.0.windows.2
Zip          = True
Lessmsi      = True
Innounp      = True
Dark         = True
Aria2        = True
Zstd         = False
[Environment]
SCOOP        = $env:USERPROFILE\scoop
[Scoop]
Outdated     = True
OnHold       = False
Config       = $env:USERPROFILE\.config\scoop\config.json
CoreRoot     = X:\~projects\~powershell\scoop
ScoopDir     = $env:USERPROFILE\scoop
CacheDir     = $env:USERPROFILE\scoop\cache
GlobalDir    = C:\ProgramData\scoop
[Config]
debug                 = True
last_update           = 10/09/2023 15:00:14
analytics_id          = <redacted>
aria2-warning-enabled = False
scoop_repo            = https://github.com/ScoopInstaller/Scoop
scoop_branch          = develop
[Windows]
DeveloperMode     = True
LongPathsEnabled  = False
ScoopDirFormat    = NTFS
GlobalDirFormat   = NTFS
WindowsDefender   = Running

Added the entries from scoop checkup and some color. Refactored is_admin and the check functions.

@niheaven
Copy link
Member

Remove the Markdown ini tag? If used in console, that's strange IMO.

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

Successfully merging this pull request may close these issues.

3 participants