diff --git a/lib/diagnostic.ps1 b/lib/diagnostic.ps1 index 4c67454cf9..9eb7579e1d 100644 --- a/lib/diagnostic.ps1 +++ b/lib/diagnostic.ps1 @@ -50,3 +50,14 @@ function check_long_paths { return $true } + +function check_envs_requirements { + if ($null -eq $env:COMSPEC) { + warn '$env:COMSPEC environment variable is missing.' + Write-Host " By default the variable should points to the cmd.exe in Windows: '%SystemRoot%\system32\cmd.exe'." + + return $false + } + + return $true +} diff --git a/libexec/scoop-checkup.ps1 b/libexec/scoop-checkup.ps1 index df4a8b6ec5..d515469cda 100644 --- a/libexec/scoop-checkup.ps1 +++ b/libexec/scoop-checkup.ps1 @@ -12,6 +12,7 @@ $issues += !(check_windows_defender $false) $issues += !(check_windows_defender $true) $issues += !(check_main_bucket) $issues += !(check_long_paths) +$issues += !(check_envs_requirements) if (!(Test-HelperInstalled -Helper 7zip)) { error "'7-Zip' is not installed! It's required for unpacking most programs. Please Run 'scoop install 7zip' or 'scoop install 7zip-zstd'."