deploy tag using environment variables

Ted's Avatar


22 Apr, 2020 09:57 AM

It may be silly but after trying several configurations, I still have no clue for the moment.

I plan to deploy some artifacts from a VS2019 build with tag and release names having timestamp in them.

I set a environment variable in before deployment script as:

$NAME='(get-date -format "yyyyMMddHHmm")

ans use $NAME as tag and release names.

The console shows

$NAME='(get-date -format "yyyyMMddHHmm")
Deploying using GitHub provider

But when create tag in github, it shows

Creating "$SP_TAG" release for repository...

I am wondering what I shall fill in the tag name and release name to get the environment variable intepreted correctly?

  1. Support Staff 1 Posted by Feodor Fitsner on 22 Apr, 2020 05:23 PM

    Feodor Fitsner's Avatar

    Deployment providers take environment variables, not PS variables.

    You should set environment variable instead:

    $env:NAME='(get-date -format "yyyyMMddHHmm")

    I'd change the name of var to something more non-generic though.

    Let me know if you have any questions.

  2. Feodor Fitsner closed this discussion on 22 Jun, 2020 09:02 PM.

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

Keyboard shortcuts


? 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