tag:blogger.com,1999:blog-4071323425779509970.post6048958595841801508..comments2019-11-24T17:00:34.686-08:00Comments on 0ptikGhost: Executing PowerShell Scripts Silently as Custom Actions with WiX0ptikGhosthttp://www.blogger.com/profile/01012603216322920425noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-4071323425779509970.post-3224106947695973722018-01-17T08:44:42.559-08:002018-01-17T08:44:42.559-08:00Instead returning the $error.count I recommend to ...Instead returning the $error.count I recommend to work with $LASTEXITCODE - this has the advantage that you can return gracefully from the script even though the error count is unequal 0Anonymoushttps://www.blogger.com/profile/01459237555952302417noreply@blogger.comtag:blogger.com,1999:blog-4071323425779509970.post-56058553910923805682013-12-19T06:43:11.160-08:002013-12-19T06:43:11.160-08:00This is exactly what I need ! But I'm a newbie...This is exactly what I need ! But I'm a newbie on wix :( can someone post the wix project so I can adapt it ! ThanksAnis HOUAIDIAhttps://www.blogger.com/profile/04050095052905667671noreply@blogger.comtag:blogger.com,1999:blog-4071323425779509970.post-62480283021560807412013-08-19T04:27:52.363-07:002013-08-19T04:27:52.363-07:00I just want to sincerely thank you for writing thi...I just want to sincerely thank you for writing this. It worked like a charm!Anonymoushttps://www.blogger.com/profile/14679640800012423806noreply@blogger.comtag:blogger.com,1999:blog-4071323425779509970.post-66625138768093559642012-12-26T17:03:49.217-08:002012-12-26T17:03:49.217-08:00OHarbe, I would recommend that you call VSDBCMD.ex...OHarbe, I would recommend that you call VSDBCMD.exe directly instead of wrapping up the command in a powershell script. If I had to make a guess there's some quoting problem or perhaps you are making an assumption that holds true when you are executing in "isolated mode" but not when executing in the compiled msi. If you are still set on using a powershell script, then I would recommend that you write out the command line you are trying to execute somewhere so that you can check that it looks as expected.0ptikGhosthttps://www.blogger.com/profile/01012603216322920425noreply@blogger.comtag:blogger.com,1999:blog-4071323425779509970.post-12725380230986095452012-12-26T16:58:06.597-08:002012-12-26T16:58:06.597-08:00@Greg: The [#Invoke_Test.ps1] reference is in erro...@Greg: The [#Invoke_Test.ps1] reference is in error. It should be [#InvokeTestPS1]. I've update the post with the correction.0ptikGhosthttps://www.blogger.com/profile/01012603216322920425noreply@blogger.comtag:blogger.com,1999:blog-4071323425779509970.post-63872338298124677252012-12-26T09:33:23.671-08:002012-12-26T09:33:23.671-08:00I realize this is quite old but I am trying to get...I realize this is quite old but I am trying to get something similar working and I am not seeing the definition for the [#Invoke_Test.ps1] reference.Greg Proschhttps://www.blogger.com/profile/16500254936599705699noreply@blogger.comtag:blogger.com,1999:blog-4071323425779509970.post-85242251031962219232012-07-01T12:38:19.022-07:002012-07-01T12:38:19.022-07:00I would be grateful if you would be able to advise...I would be grateful if you would be able to advise me on this issue. I came across a weird issue with Wix executing powershell script that has interaction with command line to execute VSDBCMD.exe. The script runs fine in isolated mode but when fired via the compiled msi installer the installation completes successfully and log file created with some logging text but the command line step for VSDBCMD.exe is skipped and ignored.<br />Line Sample ###<br />& $Tool /a:Deploy "`"/cs: Server=$SERVERNAME;User ID=$DBUSERNAME;Password=$DBPASSWORD;`"" /dsp:Sql /dd+ /model:$DbSchema /p:TargetDatabase=$DATABASENAME /manifest:$DeployManifest 2>&1 | write-outputOHarbehttps://www.blogger.com/profile/06375562367212232562noreply@blogger.comtag:blogger.com,1999:blog-4071323425779509970.post-70296508840070282662011-10-14T10:36:14.366-07:002011-10-14T10:36:14.366-07:00@derek: Absolutely right! I've updated the pos...@derek: Absolutely right! I've updated the post with your corrections. Thanks!0ptikGhosthttps://www.blogger.com/profile/01012603216322920425noreply@blogger.comtag:blogger.com,1999:blog-4071323425779509970.post-25099982312599878242011-10-14T01:19:27.675-07:002011-10-14T01:19:27.675-07:00there are some errors above...
The Before attribut...there are some errors above...<br />The Before attribute on the SetProperty Id="InvokeTestPS1" node is incorrect - it should be Before="InvokeTestPS1".<br />Also, the value references a property called [POWERSHELL.EXE] but it should be [POWERSHELLEXE] as defined above in the registry search.derekhttps://www.blogger.com/profile/17633436262087995897noreply@blogger.com