tag:help.appveyor.com,2012-11-13:/discussions/problems/24804-ps-script-before-buildAppVeyor: Discussion 2019-10-15T03:25:54Ztag:help.appveyor.com,2012-11-13:Comment/475368442019-08-19T07:18:26Z2019-08-19T07:18:26ZPS Script before build <div><p>This is what happened</p></div>mark.garciatag:help.appveyor.com,2012-11-13:Comment/475368442019-08-19T16:34:12Z2019-08-19T16:34:12ZPS Script before build <div><p>Can you go to the project's <code>Export YAML</code> tab and download the config file it produces and post it here.</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/475368442019-08-19T23:06:48Z2019-08-19T23:06:48ZPS Script before build <div><p>version: 1.0.{build}<br>
image: Visual Studio 2017<br>
configuration: Release<br>
environment:<br>
API_DOMAIN_NAME: <a href="https://api8.hometesterclub.com">https://api8.hometesterclub.com</a> before_build:<br>
- ps: >- Install-Product node $Env:nodejs_version</p>
<pre>
<code>npm install -g npm
npm install -g webpack
npm install -g webpack-cli
cd %APPVEYOR_BUILD_FOLDER%
cd BuchananGroup.Plugin
((Get-Content -path .\src\services.js -Raw) -replace 'http://htc_api.local',$env:API_DOMAIN_NAME) | Set-Content -Path .\src\services.js
npm install
npm run build
cd %APPVEYOR_BUILD_FOLDER%
nuget restore</code>
</pre>
<p>build:<br>
publish_wap: true verbosity: minimal artifacts:<br>
- path: BuchananGroup.Plugin\dist\widget.js name: WidgetJs deploy:<br>
- provider: Environment name: HTC-Api-Beta on: branch: master</p></div>mark.garciatag:help.appveyor.com,2012-11-13:Comment/475368442019-08-20T13:30:54Z2019-08-20T13:30:54ZPS Script before build <div><p>It's quite perplexing indeed. I can't see anything wrong except for the fact that you are using cmd variable syntax <code>%APPVEYOR_BUILD_FOLDER%</code> for powershell (should use <code>$env:APPVEYOR_BUILD_FOLDER</code>) but that doesn't seem to be the problem here.</p>
<p>Can you try to remove all but the first few commands and run a build.<br>
Also, if this is blocking you, I'm guessing that checking in an <code>appveyor.yml</code> file with the above config in it would not run into this error. Though, of course, we'd still like to find out why this error is occurring.</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/475368442019-08-20T15:49:48Z2019-08-20T15:49:48ZPS Script before build <div><p>Removing all the script would successfully build and I think adding them into an appveyor.yml file would also work but I am trying to avoid adding a yml because I need to push to git everytime I want to try something in the build process.</p></div>mark.garciatag:help.appveyor.com,2012-11-13:Comment/475368442019-08-20T21:16:42Z2019-08-20T21:16:42ZPS Script before build <div><p>Would you be able to add me (<a href="mailto:owenmcdonnell@appveyor.com">owenmcdonnell@appveyor.com</a>) as a collaborator with build permissions to this project so that i could investigate further?</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/475368442019-08-21T05:56:51Z2019-08-21T05:56:51ZPS Script before build <div><p>I don't think it will be allowed. I think I'll just use the appveyor file. Will let you know if it works.</p></div>mark.garcia