MSBUILD in Powershell

jezz.santos's Avatar

jezz.santos

02 Jan, 2016 07:34 AM

Just switched my build_script from CMD to PS:

this is what I have, but it fails.

How to fix this?

environment:
  buildconfig: Release
  azureconfig: Local
  solutionname: Gene.sln
build_script:
- ps: >-
    cd src
    &msbuild.exe $solutionname /t:Rebuild /p:Configuration=$env:buildconfig;TargetProfile=$env:azureconfig /verbosity:minimal
    cd..
  1. Support Staff 1 Posted by Feodor Fitsner on 02 Jan, 2016 07:52 AM

    Feodor Fitsner's Avatar

    Try this:

    build_script:
    - ps: |
        cd src
        msbuild.exe $solutionname /t:Rebuild /p:Configuration=$env:buildconfig;TargetProfile=$env:azureconfig /verbosity:minimal
        cd..
    
  2. 2 Posted by jezz.santos on 02 Jan, 2016 07:57 AM

    jezz.santos's Avatar

    Yay! that got me to this point!

    Is there something else I need to do to the arguments of that msbuild line?

    (sorry, not skilled at PS)

  3. Support Staff 3 Posted by Feodor Fitsner on 02 Jan, 2016 08:02 AM

    Feodor Fitsner's Avatar

    Try this:

    msbuild.exe $solutionname /t:Rebuild "/p:Configuration=$env:buildconfig;TargetProfile=$env:azureconfig" /verbosity:minimal
    
  4. 4 Posted by jezz.santos on 02 Jan, 2016 08:07 AM

    jezz.santos's Avatar

    awesome thanks. That was killing me!!!

  5. jezz.santos closed this discussion on 02 Jan, 2016 08:07 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac