Note that you are subject to PowerShell execution policy. Before Server 2012 R2, the default was Restricted which will block all PowerShell execution outside of a PowerShell Concole or ISE. Many networks have GPO that will detect changes to the ExecutionPolicy and revert it back.
With Server 2012 R2, the default is a more sensible RemoteSigned, but this requires your scripts are signed--not hard to do, but also not commonly done. It is possible to execute PowerShell cmdlets in C# and avoid ExecutionPolicy. -- John Merryweather Cooper Senior Software Engineer | Enterprise Service Applications | Continuing Development Jack Henry & Associates, Inc.® | Lenexa, KS 66214 | Ext: 431050 |jocoo...@jackhenry.com -----Original Message----- From: Pavan Konduru [mailto:pavan.kond...@accelrys.com] Sent: Tuesday, December 16, 2014 3:05 PM To: General discussion about the WiX toolset. Subject: Re: [WiX-users] CustomAction to run powershell script Also the PropCA must run before the UpdateIdentityCA in the Installexecute sequence. -----Original Message----- From: Pavan Konduru [mailto:pavan.kond...@accelrys.com] Sent: Tuesday, December 16, 2014 12:59 PM To: General discussion about the WiX toolset. Subject: Re: [WiX-users] CustomAction to run powershell script Did you add the Execute="immediate" to the CustomAction "PropCA"? -----Original Message----- From: wixtester [mailto:sangee...@hotmail.com] Sent: Tuesday, December 16, 2014 12:51 PM To: wix-users@lists.sourceforge.net Subject: Re: [WiX-users] CustomAction to run powershell script Thanks for pointing out the missing quote. After fixing that, I am still not able to run the ps script. Also, I am now enclosing the quotes around the file path like this - -File "C:\Program Files (x86)\XXXX\Bridge Server\Bridges\Exchange\UpdateIdentity.ps1 " testhub\ericd pwd1 Why is WixCA not happy with the command? I can manually run the command without any errors. CustomActionSchedule(Action=UpdateIdentityCA,ActionType=3073,Source=BinaryData,Target=CAQuietExec,CustomActionData="C:\Windows\WindowsPowerShell\v1.0\powershell.exe -Version 2.0 -NoProfile -NonInteractive -InputFormat None -ExecutionPolicy Bypass -File "C:\Program Files (x86)\XXXX\Bridge Server\Bridges\Exchange\UpdateIdentity.ps1 " testhub\ericd pwd1 ) MSI (s) (8C:BC) [15:43:22:575]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI156D.tmp, Entrypoint: CAQuietExec MSI (s) (8C:FC) [15:43:22:575]: Generating random cookie. MSI (s) (8C:FC) [15:43:22:617]: Created Custom Action Server with PID 3620 (0xE24). MSI (s) (8C:9C) [15:43:23:663]: Running as a service. MSI (s) (8C:9C) [15:43:23:696]: Hello, I'm your 32bit Elevated custom action server. CAQuietExec: Error 0x80070002: Command failed to execute. CAQuietExec: Error 0x80070002: CAQuietExec Failed CustomAction UpdateIdentityCA returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox) Thanks, sangeeta -- View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/CustomAction-to-run-powershell-script-tp7598607p7598610.html Sent from the wix-users mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users NOTICE: This electronic mail message and any files transmitted with it are intended exclusively for the individual or entity to which it is addressed. The message, together with any attachment, may contain confidential and/or privileged information. Any unauthorized review, use, printing, saving, copying, disclosure or distribution is strictly prohibited. If you have received this message in error, please immediately advise the sender by reply email and delete all copies. ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users