PesterInAction icon indicating copy to clipboard operation
PesterInAction copied to clipboard

Sorry to disturb in github, but I have a pressing question to consult

Open guguji5 opened this issue 7 years ago • 2 comments

I am so sorry to disturb here, I have watched your blog https://kevinmarquette.github.io/2017-04-22-Powershell-installing-remote-software/#index, and followed your steps you mentiond. But my program.exe doesn't install successfully

I have pre-copy my build in the remote machine. my code is as below:

$secPassword = ConvertTo-SecureString "June25!!" -AsPlainText -Force
$cred = New-Object system.Management.Automation.PSCredential("advent\axyssu", $secPassword)

$session = New-PSSession -ComputerName cosmoxydev8 -Credential $cred

invoke-Command -Session $session -ScriptBlock {
    $folder = 'C:\Users\axyssu\Desktop\17_20_0_1259'
    $arg = '/zFirmServer:vmsfaxys01;FirmUser:sa;FirmPassword:Advent.sa;FirmDatabase:APXFirm;SuppressDialogs/silent'

    write-host "before"
    Start-Process -FilePath "Setup.exe" -WorkingDirectory $folder -ArgumentList $arg -Wait
    write-host "after" 
}

but the powrshell window is handing as below

image I run the script inside the invoke-command in the remote directly, it could installs successfully without any interaction. The username and password is absolutely correct.

But it doesn't work.

Could you give some suggestions to figure out? Thanks in advance.

guguji5 avatar Mar 13 '18 09:03 guguji5

This would be a good question on http://www.reddit.com/r/powershell

Every installer is very different. does it have an install log file? My suspicion is that it requires an interactive desktop because it is showing an invisible dialog. Even though you tell it to suppress messages, it may be doing it an incorrect way. Just by looking at that non-standard approach for command line arguments, I would suspect the installer is poorly written.

Does it wrap a msi file? clear your temp folder, then start a normal install, then check the temp for a msi. I have had luck in the past by ripping the installer our of the exe shell like that.

KevinMarquette avatar Mar 13 '18 10:03 KevinMarquette

Thank you for your reply. image

With the help of my colleague, I find the setup.exe has launched and running in the session 0. But it hung there. As you say, maybe our installer has to run in the interactive session.

guguji5 avatar Mar 14 '18 01:03 guguji5