-
Notifications
You must be signed in to change notification settings - Fork 205
Open
Description
What New Or Updated Would You Like To See?
In the section https://docs.chocolatey.org/en-us/guides/organizations/set-up-chocolatey-server/#setup-with-powershell-script, replace
if ($null -eq (Get-Command -Name 'choco.exe' -ErrorAction SilentlyContinue)) {
Write-Warning "Chocolatey not installed. Cannot install standard packages."
Exit 1
}
with
if ($null -eq (Get-Command -Name 'choco.exe' -ErrorAction SilentlyContinue)) {
Write-Error "Chocolatey not installed. Cannot install standard packages." -ErrorAction Stop
}
Why Is It Needed?
Exit
will terminate the current PowerShell session, wiping any information needed or opportunity for troubleshooting for the user.
If the script is run from a PowerShell console, the console will be terminated as well.
Additional Context?
I assume Exit 1
is for legacy error handling if the PowerShell script is called from cmd.exe
...
Metadata
Metadata
Assignees
Labels
No labels