Jump to content

Using Chocolatey From Terminal


PHIstw

Recommended Posts

Hi

 

I am trying to deploy a new solution on my systems and I thought of a combo Chocolatey + PulseWay in order to facilitate deployement. I managed to install choco using the command:

@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

 

When going to the targeted system, I can use choco without any issue. However, from the terminal or scripts in Pulseway, the command "choco" is not recognized. Would you have any idea why and how I can fix this?

 

Thank you,

Regards

Link to comment
Share on other sites

  • 1 month later...

Try using the full path to choco.exe in your scripts, like this:
 

@ECHO OFF
IF EXIST C:\ProgramData\chocolatey\choco.exe (
	C:\ProgramData\chocolatey\choco.exe install curl --no-progress -y
    ) ELSE (ECHO Chocolatey is not installed - Aborting!)
Exit 0;

 

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...