Note that there are some explanatory texts on larger screens.

plurals
  1. POPowerShell Script in PostBuild
    primarykey
    data
    text
    <h1>Continuous Integration</h1> <p>I have been working on a PowerShell script to keep our development process streamlined. I was planning on running it as a post-build event, but I'm having some trouble.</p> <p>From the PowerShell prompt, the following works wonderfully:</p> <pre><code>PS C:\&gt; ./example.ps1 </code></pre> <p>However, when attempting to run this from <code>cmd.exe</code> as follows:</p> <pre><code>C:\&gt; powershell -command "&amp;\"C:\path to script\example.ps1\"" </code></pre> <p>The script executes but I get a round of errors back from PowerShell, consisting mostly of path resolution errors from the <code>resolve-path</code> function:</p> <blockquote> <p>Resolve-Path : Cannot find path 'C:\Documents and Settings\bdunbar\My Documents \Visual Studio 2008\Projects\CgmFamilyComm\FamilyComm\iirf\cms\isapirewrite4.dl l' because it does not exist. At C:\Documents and Settings\bdunbar\My Documents\Visual Studio 2008\Projects\C gmFamilyComm\scripts\cms.ps1:4 char:27 + $iirfpath = (resolve-path &lt;&lt;&lt;&lt; ../iirf/cms/isapirewrite4.dll).path,</p> <p>Resolve-Path : Cannot find path 'C:\Documents and Settings\bdunbar\My Documents \Visual Studio 2008\Projects\CgmFamilyComm\FamilyComm\familycomm' because it do es not exist. At C:\Documents and Settings\bdunbar\My Documents\Visual Studio 2008\Projects\C gmFamilyComm\scripts\cms.ps1:5 char:27 + $vdirpath = (resolve-path &lt;&lt;&lt;&lt; ../familycomm).path</p> </blockquote> <p>Is there a way to work around this? Could it be an issue with running <code>resolve-path</code> under <code>cmd.exe</code>?</p> <h1>[Update]</h1> <p>I've been able to change things to get around the errors that are occurring, but I still receive errors that work perfectly fine from the powershell command prompt. I can't figure out what the difference is.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload