I am creating a PowerShell script that automates the Oracle software install. Right now everything is working correctly until I trying and setup the two listeners for the software.
When manually installing the database software you have to open a new shell and execute these two commands after the software has been installed....
netca -silent -responsefile c:\path\to\netca_listener.rsp
netca -silent -responsefile c:\path\to\netca_callout_listener.rsp
I have been trying to execute these two rsp files like so..
saps -FilePath cmd.exe -ArgumentList "/c", "netca", "-silent", "-responsefile $first_rspfile" -WindowStyle Hidden -Wait
Typically the process will spin briefly, but then will do nothing, and the response files will pop open when the process starts running.
Any clues to what might be going on?
You don't need cmd /c in PowerShell. Try this:
Start-Process -FilePath "netca.exe" `
-ArgumentList #("-silent", "-responsefile $first_rspfile") `
-WindowStyle "Hidden" -Wait
Related
I have a powershell script which will install an exe. It works fine when i try it from a powershell ISE console, but it fails when i try it from TFS build step.
Note : My TFS user, agent user and triggering user are same.
Could anybody can shed some light on this issue ?
Start-Process -FilePath $installerFileName -Verb "runas" -ArgumentList $parameter -Wait
The above code is using to install the exe. $parameter is a list of custom parameters.
I am getting below error
[WixSession.GetSession][GetSessionValues]exception: Value cannot be null. Parameter name: s
What kind of exe are you trying to install? Dose that support silent installation? If UI pop up during the installation, then the agent needs to run in interactive mode.
Test on my side with below command to install/unistall the notepad++ with service mode, everyting works as expected:
start-process -FilePath "D:\Software\npp.7.5.8.Installer.x64.exe" -ArgumentList '/S' -Verb runas -Wait
And:
start-process -FilePath "C:\Program Files\Notepad++\uninstall.exe" -ArgumentList '/S' -Verb runas -Wait
I'm having a weird problem.
I have an InstallShield project (which creates setup.exe) that contains a custom action item - calling a powershell script.
All the script does is to install 3 adobe reader updates (1 exe file and 2 msp files) on top of the already installed Adobe Reader 11.0.0.
When I'm calling the script my self - it works fine.
However, after the setup.exe finishes, it seems like only one update (the exe file) was really installed (the adobe reader version after the install is 11.00.10 which is the result of running only the exe file..).
All 3 adobe updates sit in the same folder and the powershell script first sets it location to this folder.
When running the updates manually after the installation - it also works fine and updates it to 10.00.22 (what it should be).
Any ideas why is this happening?
Here's my powershell script:
Set-Location "C:\myProject\adobeUpdates"
Start-Process .\AdbeRdr11010_en_US.exe -ArgumentList '/q /norestart /sPB /rs /msi' -WindowStyle hidden -Wait
ping 1.1.1.1 -n 1 -w 10000 # Tried to add a delay but wasn't helpful
Start-Process -FilePath “AdbeRdrUpd11021.msp” -ArgumentList '/qn' -Wait
Start-Process -FilePath “AdbeRdrUpd11022_incr.msp” -ArgumentList '/qn' -Wait
Thank you very much
Solved it, this is the working script:
Set-Location "C:\myProject\adobeUpdates"
Start-Process .\AdbeRdr11010_en_US.exe -ArgumentList '/q /norestart /sPB /rs /msi' -WindowStyle hidden -Wait
ping 1.1.1.1 -n 1 -w 10000
Start-Process .\AdbeRdrUpd11021.msp -ArgumentList '/qn' -Wait
Start-Process .\AdbeRdrUpd11022_incr.msp -ArgumentList '/qn' -Wait
I'm not sure what is the different and would love someone to explain but anyway it works just fine now.
I am trying to install trial version of Lotus Notes Designer using Powershell command
Start-Process -FilePath "EXEPath" -Verb runAs -ArgumentList "/qn"
But this command displays the normal installation wizard, how do I make it a silent installation?
Silent Install commands vary depending on the program itself and the installer they have used. Using /qn will work for most (but not all!) MSI installers, as there is a Microsoft standard that most will follow, but EXE installers can be very different as they do not have guidelines like an MSI.
Searching for the name of the program and 'silent install' will likely bring up the programs help pages or a blog which lists the commands you will need to use.
A search for "lotus notes designer silent install" brings up this article which lists the command as:
setup.exe /s /v"/qn"
Which you would use like this:
Start-Process -FilePath "C:\folder\setup.exe" -Verb runAs -ArgumentList '/s','/v"/qn"'
Note: I can't test this as I don't use Lotus Notes, but it should work, or at least give you a good idea on what to do.
Please try below command in powershell, it will install silently along with wait and ouput. Note: Your installer should be supporting /S option and didn't try with LotusNotes.
Start-Process .\installer.exe /S -NoNewWindow -Wait -PassThru
use this
Start-Process -FilePath "D:\Software\app.exe /S /NoPostReboot _?=D:\Software\app.exe" -NoNewWindow -Wait -PassThru $process.ExitCode
I have following PowerShell script to install application without user intervention:
Start-Process -FilePath "C:\Temp\UpgradeClientInstaller\setup.exe" -ArgumentList "/S /v/qn"
by giving /s in argument list, it should install silently without user intervention but a popup is showing
Even I try with winrar.exe and zip.exe files giving the same result. Is this right way to do?
Have you tried the following command?
Start-Process -Wait -FilePath "C:\Setup.exe" -ArgumentList "/S" -PassThru
Please try this:
$pathvargs = {C:\Temp\UpgradeClientInstaller\setup.exe /S /v/qn }
Invoke-Command -ScriptBlock $pathvargs
Try this:
Start-Process -Wait -FilePath C:\setup.exe -Argument "/silent" -PassThru
Start-Process -Wait -FilePath "\full\path\setup.exe" -ArgumentList '/S','/v','/qn' -passthru
The quotes of the execute file are not necessarily.
I know the post is super old, but I feel like I could share some insight on the matter
I had to do something similar a few years ago. When you click "install" on the prompt, all it's doing is adding the cert to the TrustedPublisher store. That prompt can be avoided if you manually add it to the cert manager prior to running the installer.
I found that if you install the program on a test machine, you can export the Cert from certmgr.msc. Then you can install the cert using:
certutil -addstore "TrustedPublisher" <PathTo.cerFile> >nul 2>nul
This will install the cert to the TrustedPublisher store therefore eliminating the need for that message to appear.
I hope this helps Ramesh as well as anyone else who finds this in the future
Use this command it will not ask for any click on next and install the software.
Start-Process -Wait -ArgumentList "/silent" -PassThru -FilePath 'C:\Users\filename.exe'
Your problem seems to be Windows UAC and not the script itself.
Go to Control Panel -> System and Security -> Security and Maintenance
Click Change User Account Control settings.
Set the slider to "Never Notify".
This may be risky - but it works.
add the -NoNewWindow to stop the popup
Using a PowerShell script I'm trying to execute SqlPackage.exe to update a database. The problem is that it spawns a new CMD window and I can't capture the output effectively.
Here is my script:
&$SqlPackage "/Action:Script", "/SourceFile:$($Environment.PackageFile)", "/Profile:$($Environment.PublishProfile)", "/OutputPath:$($Environment.ScriptFile)";
where SqlPackage = "SQLPackage\SqlPackage.exe";.
Strangely when I execute the script on a Windows 2008 R2 web server the output is inline with the PowerShell output, which is ideally what I want. On my Windows 7 machine it spawns a new CMD window.
How can I route the output to the PowerShell window all the time, or at least pipe to another file?
Edit
Full solution with waiting for process to finish:
$p = Start-Process $SqlPackage -ArgumentList #("/Action:Script", "/SourceFile:$($Environment.PackageFile)", "/Profile:$($Environment.PublishProfile)", "/OutputPath:$($Environment.ScriptFile)") -NoNewWindow -Wait -Passthru
$p.WaitForExit()
You should be able to get the result you are looking for if you use Start-Process with the -NoNewWindow parameter:
Start-Process $SqlPackage -ArgumentList #("/Action:Script", "/SourceFile:$($Environment.PackageFile)", "/Profile:$($Environment.PublishProfile)", "/OutputPath:$($Environment.ScriptFile)") -NoNewWindow
If you need to direct the output to a file you can also use the -RedirectStandardOutput / -RedirectStandardError parameters of Start-Process