Eggsplorer Posted January 27, 2016 Posted January 27, 2016 (edited) 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 Edited January 27, 2016 by Eggsplorer
AutoBert Posted January 27, 2016 Posted January 27, 2016 (edited) You forgot the 2. parameter if you didn't know what to use just use '' or @scriptdir. Btw.: soon is easter, a good time to eggsplore gardens, parks etc. Edited January 27, 2016 by AutoBert
Eggsplorer Posted January 28, 2016 Author Posted January 28, 2016 Ah right. That's why it worked with @SystemDir. Now I am using @UserProfileDir since I am logged in as "Administrator". I am still receiving the same error (red font in original post). How can this be? AutoIt uses the same command as I pasted to cmd! Is there an other way to execute PowerShell commands with AutoIt? Btw.: I am eggsploring AutoIt for now
rudi Posted February 11, 2016 Posted February 11, 2016 Hi. 1st of all: I have no experience at all with Powershell 5.0, Packet Handling is nothing I've ever used so far. The message is telling ... keine Übereinstimmung für die angegebenen Suchkriterien und den Paketnamen "Firefox" So it looks, that within the context something is not available, when started within a @comspec Maybe one of the other commands from here might help to work out, what exactly is missing? Get-Package -Source <string> [-ListAvailable] [-Updates] [-ProjectName] [-Filter <string>] [-First <int>] [-Skip <int>] [-AllVersions] [-IncludePrerelease] [-PageSize] Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now