deploy tag using environment variables

Ted's Avatar

Ted

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")
$NAME

ans use $NAME as tag and release names.

The console shows

...
$NAME='(get-date -format "yyyyMMddHHmm")
$NAME
202004220511
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.

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