This project is read-only.

Execute-Process issue - Newb Question

Topics: Archive - General
Mar 25, 2014 at 4:56 PM
First off, guys thanks so much for this tool. It has really simplified things for me in my organization where I'm typically the sole application packager for SCCM.

While I'm certainly no expert, I've been banging my head on this one. For some reason, when using Execute-Process to call an .exe, I'm getting the Windows Installer pop up window. I've looked over everything 4 times now at least and I'm sure I'm missing it, but it eludes me.

Attached is the pop-up I'm seeing, along with the log file for this particular deployment. Thanks in advance.
Image

Log File:
[25-03-2014 10:43:05] [Post-Installation] ----------------------------------------------------------------------------------------------------------
[25-03-2014 11:34:15] [Initialization] Cisco_AnyConnectVPNClient2.5_2.5_EN_01 setup started.
[25-03-2014 11:34:15] [Initialization] Script [C:\Windows\ccmcache\v\AppDeployToolkit\AppDeployToolkitExtensions.ps1] dot-source invoked by [C:\Windows\ccmcache\v\AppDeployToolkit\AppDeployToolkitMain.ps1]
[25-03-2014 11:34:15] [Initialization] Script [C:\Windows\ccmcache\v\AppDeployToolkit\AppDeployToolkitMain.ps1] dot-source invoked by [C:\Windows\ccmcache\v\Deploy-Application.ps1]
[25-03-2014 11:34:15] [Initialization] Cisco_AnyConnectVPNClient2.5_2.5_EN_01 script version is [1.0.0]
[25-03-2014 11:34:15] [Initialization] Deploy Application script version is [3.1.0]
[25-03-2014 11:34:15] [Initialization] The following non-default parameters were passed to [Deploy Application]: [-DeploymentType Install]
[25-03-2014 11:34:15] [Initialization] App Deploy Toolkit Main script version is [3.1.0]
[25-03-2014 11:34:15] [Initialization] App Deploy Toolkit Extensions version is [1.0.0]
[25-03-2014 11:34:15] [Initialization] PowerShell version is [2.0 x86]
[25-03-2014 11:34:15] [Initialization] PowerShell host is [ConsoleHost version 2.0]
[25-03-2014 11:34:15] [Initialization] OS version is [Microsoft Windows 7 Enterprise 32-bit 6.1.7601]
[25-03-2014 11:34:15] [Initialization] Hardware platform is [Virtual:Hyper-V]
[25-03-2014 11:34:15] [Initialization] Computer name is [WJAXPACKAGETEST]
[25-03-2014 11:34:15] [Initialization] Current user is [AZCHEM\WJAXPACKAGETEST$]
[25-03-2014 11:34:16] [Initialization] Current Culture is [en-US] and UI language is [EN]
[25-03-2014 11:34:16] [Initialization] Deployment type is [Installation]
[25-03-2014 11:34:16] [Initialization] Installation is running in [Silent] mode.
[25-03-2014 11:34:16] [Installation] Executing [C:\Windows\ccmcache\v\Files\anyconnect-2.5.exe /S /v/qn]...
[25-03-2014 11:34:16] [Installation] Working Directory is [C:\Windows\ccmcache\v\Files]
[25-03-2014 11:50:20] [Installation] Execution failed with code: 1639
[25-03-2014 11:50:20] [Installation] Cisco_AnyConnectVPNClient2.5_2.5_EN_01 Installation completed with exit code [1639].
[25-03-2014 11:50:20] [Installation] ----------------------------------------------------------------------------------------------------------

App Deploy Toolkit Script:
#*===============================================
#* INSTALLATION 
$installPhase = "Installation"
#*===============================================

    # Install 
    Execute-Process -FilePath "$dirFiles\anyconnect-2.5.exe" -Arguments "/S /v/qn" -WindowStyle Hidden

#*===============================================
#* POST-INSTALLATION
$installPhase = "Post-Installation"
#*===============================================

    #Create Profile Directory
    Mkdir -Path "$envLOCALAPPDATA\Cisco\Cisco AnyConnect VPN Client\"

    # Copy VPN Profile
    Copy-File -Path "$dirSupportFiles\Preferences.xml" -destination "$envLOCALAPPDATA\Cisco\Cisco AnyConnect VPN Client\Preferences.xml"

#*===============================================
#* UNINSTALLATION
} ElseIf ($deploymentType -eq "uninstall") { $installPhase = "Uninstallation"
#*===============================================

    # Prompt the user to close the following applications if they are running:
    Show-InstallationWelcome -CloseApps "vpnui,vpmagent" -AllowDefer -DeferTimes 3

    # Show Progress Message (with a message to indicate the application is being uninstalled)
    Show-InstallationProgress -StatusMessage "Uninstalling Application $installTitle. Please Wait..." 

    # Remove this version of Cisco AnyConnect
    Execute-Process -FilePath "$dirFiles\anyconnect-2.5.exe" -Arguments "/uninstall"
=====================================================
Mar 25, 2014 at 7:24 PM
Hi there,
On a phone now so don't have a back tick on my keyboard, suffice to say I think you're just missing quotes around the /qn switch, you could try this or add normal quotes around it preceded by a back tick:
Execute-Process -FilePath "$dirFiles\anyconnect-2.5.exe" -Arguments '/S /v"/qn"' -WindowStyle Hidden

Seán

Mar 27, 2014 at 8:51 PM
Seán,

Sorry I'm late getting back and I appreciate you responding so quickly. I've tried modifying the quotes as you suggested, I even tried it by dropping the arguments altogether. Still no luck. At this point, I've acquired the MSI installer and I'm going to try this with another approach.
Apr 23, 2014 at 9:34 PM
I've recently run into this issue as well...
Execute-Process -FilePath "LOTUS_Notesclient_853_WIN_EN_EVA.exe" -Arguments '/s /v" /qn"'
Has not been working for me. The installer requires the exact syntax of .exe /s /v"/qn". I've even tried doing .exe "/s /v/qn" which has worked for me on another .exe installer, but not for this one.
Apr 24, 2014 at 8:30 PM
You might want to try backticking the quotes to tell Powershell to ignore them. By default, quotes mean "execute me". Try this:
Execute-Process -FilePath "LOTUS_Notesclient_853_WIN_EN_EVA.exe" -Arguments '/s /v`" /qn`"'
Apr 24, 2014 at 9:45 PM
Thank you darktempest, I found the issue... I had the syntax correct, but it was being used on the wrong executable. The "support" site neglected to inform me that I would have to run this executable, wait for it to extract and cancel the install, go to the system temp folder and use those install files which would contain the "Setup.exe" that supported those install switches. Talk about jumping through hoops.