Scoop icon indicating copy to clipboard operation
Scoop copied to clipboard

Add new subcommand "scoop diag"

Open r15ch13 opened this issue 2 years ago • 4 comments

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:

  • [x] I have read the Contributing Guide.
  • [x] 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 avatar Jun 16 '23 17:06 r15ch13

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

HUMORCE avatar Jun 18 '23 14:06 HUMORCE

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

HUMORCE avatar Jun 19 '23 01:06 HUMORCE

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.

r15ch13 avatar Oct 09 '23 17:10 r15ch13

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

niheaven avatar Oct 18 '23 10:10 niheaven