Search the Community
Showing results for tags 'chocolatey'.
-
Hi, I would like to install chocolatey packages (OneGet) via Autoit. Manually without Autoit I would just open Powershell and use this command: Install-Package -Name Firefox -Force It also works with cmd (see attachment 1) powershell.exe -Command Install-Package -Name Firefox -Force With Autoit I tried the following code: RunWait(@ComSpec & ' /k ' & 'powershell.exe -Command Install-Package -Name Firefox -Force', @SW_SHOW) It doesnt work at all. I don't even see a cmd window. When I add @SystemDir the Windows appears with the error in attechment 2. Is there another way to run PowerShell Commands with Autoit? I would like to avoid starting Powershell, waiting for the window, sending the command and sending Enter. Thanks Eggsplorer
- 3 replies
-
- autoit
- powershell
-
(and 2 more)
Tagged with:
-
Hi, I want to install chocolatey (https://chocolatey.org/) with AutoIt. I just need to send the following command to cmd: @powershell -NoProfile -ExecutionPolicy unrestricted -Command "(iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))) >$null 2>&1" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\binThis is what I tried: RunWait(@ComSpec & " /C " "@powershell -NoProfile -ExecutionPolicy unrestricted -Command "(iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))) >$null 2>&1" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin", "");It didn't work propably because of the quotes. So I tried this: $code1 = "@powershell -NoProfile -ExecutionPolicy unrestricted -Command" $code2 = " (iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))) >$null 2>&1" $code3 = " && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" RunWait(@ComSpec & " /C " & $code1 & $code2 & $code3, "");Didn't work either. Any help? Thanks in advance =)
- 4 replies
-
- chocolatey
- cmd
-
(and 3 more)
Tagged with: