% in windows cmd

Markus Diem's Avatar

Markus Diem

17 Jun, 2020 01:00 PM

AppVeyor seems to remove % in windows cmd variables?
This:

set mv=percent:%
echo %mv%

will echo percent:% on windows. However, in AppVeyor it will echo percent: (see minimal sample).
Is there a simple solution to this?

  1. Support Staff 1 Posted by Feodor Fitsner on 17 Jun, 2020 05:32 PM

    Feodor Fitsner's Avatar

    Try putting your command into a separate build.cmd and then call it from yaml:

    - build.cmd
    

    Let me know if that did the trick.

  2. 2 Posted by Markus Diem on 18 Jun, 2020 06:42 AM

    Markus Diem's Avatar

    in the end I want to put it in an encrypted variable:

    environment:
      mysecvar:
        secure: Rrtj4Qam1DdF6KXiRI7kHw==
    
    but the % is removed (and everything after) as soon as the variable is decrypted.
  3. Support Staff 3 Posted by Feodor Fitsner on 19 Jun, 2020 01:47 AM

    Feodor Fitsner's Avatar

    I'd recommend using PowerShell to work with such variables. This is the example that the variable with percent is perfectly down to worker VM and can be displayed/processed with PS: https://ci.appveyor.com/project/FeodorFitsner/simple-console/builds...

  4. 4 Posted by Markus Diem on 23 Jun, 2020 07:38 AM

    Markus Diem's Avatar

    thanks. that does the trick!

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

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

Recent Discussions

02 Jul, 2020 03:24 PM
01 Jul, 2020 08:32 PM
01 Jul, 2020 01:12 PM
30 Jun, 2020 04:26 PM
25 Jun, 2020 05:54 PM