I've written a script that downloads the MS ODBC driver, installs it, then checks the new driver .dll exists. However, I'm stuck on the "installs it" part.
The best version of the install command I have right now is: Start-Process -Filepath "msiexec.exe" -ArgumentList "/i msodbcsql.msi", "/qb", "IACCEPTMSODBCSQLLICENSETERMS=YES"
When I run this on its own (to troubleshoot it), however, the installer launches and immediately displays the error:
The required IACCEPTMSODBCSQLLICENSETERMS=YES command-line parameter is missing.
If I run Start-Process -Filepath msiexec -ArgumentList /i, "msodbcsql.msi" the regular GUI installer starts up which presumably means the "/qb", "IACCEPTMSODBCSQLLICENSETERMS=YES" part of the command is the problem.
I'm having no luck with this in spite of adapting every example I can find on the web. I'd be grateful for help!
The problem: I wasn't running PowerShell in Administrator mode 😖
Related
The goal:
Coworkers should be able to install a software by one-click via PowerShell
The issue:
I am not aware how to automate the installation of a software, e.g. the executable.
This is my code:
start-process -Verb runAs -wait '.......\setup.exe' -ArgumentList
My question:
I couldn't find any valid values for the "-ArgumentList"? How do I tell PowerShell which Options (Radio buttons) to press when running the installation in the background? Is there a standard of valid arguments, or how do I find out which ones are valid for the specific exe?
Thanks for your help in advance!
I am using Powershell 7 to install .MSI application with some arguments (same installation with same arguments passed well when using for example Ansible tool).
Every time I try to run script I am getting Windows Installer pop up window which someone mentioned ( someone wrote "This pop up is the msiexec help pop up. It’s telling you it doesn’t like your command line"). I tried several different orders but always getting this failure.
I saw there was similar issue but it was completely different issue with Accepting License Terms, I do not have issue with that.
My arguments are:
$webDeployInstallerFilePath = "C:\fa_components\PRIME\SUN TEST 2020.1 (x64).msi"
$switch2 = #(
"i `"$webDeployInstallerFilePath`""
"/quiet"
"passive"
"/l* C:\tmp_installation\logs\Prime_log.txt"
"INSTALLDIR=C:\"
"FRONTINIDIR=C:\ProgramData\Front\64bit\ini\"
"FRONTINILOG=C:\ProgramData\Front\64bit\log\"
"PRIME=C:\TEST Arena\"
"ProgramMenuFolder=C:\ProgramData\"
"COMMONAPPDATA_FRONTDIR=C:\ProgramData\Front\"
"COMMONAPPDATA_FRONT64BITDIR=C:\ProgramData\Front\64bit\"
"CommonAppDataFolder=C:\ProgramData\"
)
Program requires some of it needed argumets.
I try to execute it with:
Start-Process msiexec.exe -ArgumentList $switch2 -Wait
I try to run my .ps1 script but as I mentioned I am getting only picture with windows installer and nothing happens (you can see that on following link)
windows installer picture
Thanks in advance!
Yes, a few problems.
"i" should be "/i" (note the forward slash)
"passive" should be "/passive" (note the forward slash)
Because it has a space in the path, "PRIME=C:\TEST Arena\" should be "PRIME="C:\TEST Arena\""
Examples here: https://www.alkanesolutions.co.uk/2018/07/18/install-and-uninstall-msi-using-powershell/
$switch2 = #(
"/i `"$webDeployInstallerFilePath`""
"/quiet"
"/passive"
"/l* C:\tmp_installation\logs\Prime_log.txt"
"INSTALLDIR=C:\"
"FRONTINIDIR=C:\ProgramData\Front\64bit\ini\"
"FRONTINILOG=C:\ProgramData\Front\64bit\log\"
"PRIME=`"C:\TEST Arena\`""
"ProgramMenuFolder=C:\ProgramData\"
"COMMONAPPDATA_FRONTDIR=C:\ProgramData\Front\"
"COMMONAPPDATA_FRONT64BITDIR=C:\ProgramData\Front\64bit\"
"CommonAppDataFolder=C:\ProgramData\"
)
Am trying to extract Ruby Devkit Tdm package using below command,
Start-Process "C:\DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe" -ArgumentList "-o'C:\Ruby-DevKit' -y" -PassThru -Wait
but its having 7-zip unknown error. I found in Google for NSIS script which has to perform this and below is the query,
ExecWait '"$TEMP\${devkit_installer}" x -o"${devkit_path}" -y /silent /noreboot /nocancel /noicons' $1
Is there any similar way to perform silent unzip this using powershell?
The problem is the single quotes around the folder path in your ArgumentList, Start-Process isn't passing them as you would expect. You only need them if you have a space in your path so you can just remove them in this case:
Start-Process C:\DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe -ArgumentList "-oC:\Ruby-DevKit -y" -PassThru -Wait
If you just used the call operator to run the command it works fine with single quotes, but the installer itself does not wait to finish so the script continues whilst the install is still in process.
& C:\DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe -o'C:\Ruby-DevKit' -y
So there's two ways around your issue depending on if you want the script to wait for the install or not.
This question is realted to SCCM Client installer ccmsetup.exe. When we run manually ccmsetup.exe; it starts the installation process and exit from command prompt. I cannot monitor the installation process from commandline. It starts recording installation status in ccmsetup.log file. However time to execute completely varies per system.
How can I monitor ccmsetup.exe installation status using powershell.
I am using command as below:
Invoke-Command { C:\Client\ccmsetup.exe /Source:"C:\Client" SMSSITECODE=PPR FSP=Server1.ADDOMAIN.COM}
Thanks & regards,
Kedar
Give a shot to the start-process cmdlet :
start-process C:\Client\ccmsetup.exe -ArgumentList #( '/Source:"C:\Client"' , "SMSSITECODE=PPR" , "FSP=Server1.ADDOMAIN.COM" -wait
And tell me it works, because it works for me :)
NB : the use a simple quotes allows double-quotes to be passed to the process launched.
whenever an .exe file is executed on remote machine with help of pssession and invoke-command with start-process..
it the execuable runs in background , i am able to see the process in task manager but cpu alloted to that process is 0% and also it keeps running.
i want to pop up GUI of executable file on remote machine whenever i run script.
i tried..
1)
Invoke-Command -ScriptBlock {Start-Process -Wait -FilePath 'C:\Documents and Settings\user\Desktop\scripts\dbsetup_trial.exe' -ArgumentList '/S' -PassThru -Verb runas}
2) by enetring in PSsession, i tried executing exe, bt result was same.
please help me out.
i need to install file , if silent installation is option it should install file silently or just pop the window of executable and return back.
You cannot invoke a GUI on a remote system's interactive session via PowerShell. PowerShell remote sessions are unable to interact with other sessions, especially the logged-on user session(s).
psexec can do this, but the better way to do this is to run a silent/unattended install if it's an option with that application installer. We can't answer that because we don't know what that installer is or how it's made.