Passing version variable to powershell build_script

oeybru's Avatar

oeybru

Feb 22, 2021 @ 08:22 PM

Hi,

I'm struggling with passing the version nr string as input argument to my build script

Assembly info setup:

assembly_info:
  patch: true
  file: AssemblyInfo.*
  assembly_version: '{version}'
  assembly_file_version: '{version}'

My build script, the problem is the value to --appVersion, All I get to the script is the string "version" instead of the actual value. I have tried lots of variants with curly braces, dollar sign, quotes etc.

build_script:
  - ps: .\build.ps1 --buildPath="./path/to/bin/Release" --appId="MyAppName" --appVersion=version
How do I pass in the version value correct?
This is maybe a very basic powershell question, but I'm hoping the get some hints :)
  1. Support Staff 1 Posted by Feodor Fitsner on Feb 22, 2021 @ 08:26 PM

    Feodor Fitsner's Avatar

    Try this one:

    build_script:
      - ps: .\build.ps1 --buildPath="./path/to/bin/Release" --appId="MyAppName" --appVersion=$env:APPVEYOR_BUILD_VERSION
    
  2. 2 Posted by oeybru on Feb 22, 2021 @ 09:33 PM

    oeybru's Avatar

    Thank you very much for the solution :)

  3. oeybru closed this discussion on Feb 23, 2021 @ 09:18 AM.

  4. oeybru re-opened this discussion on Feb 23, 2021 @ 09:18 AM

Reply to this discussion

Internal reply

        No formatting (switch to Markdown)

          You can attach files up to 10MB

          If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

            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