Skip to content

Instantly share code, notes, and snippets.

@alventech
Last active June 2, 2021 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alventech/a80d1c5be5cabfef30e46cef27f6754c to your computer and use it in GitHub Desktop.
Save alventech/a80d1c5be5cabfef30e46cef27f6754c to your computer and use it in GitHub Desktop.
createtokenExpirationTime.ps1
# ARM tokenExpirationTime
# The expiration date can be no less than an hour and no more than one month.
# If you set tokenExpirationTime outside of that limit, it wont work.
# tokenExpirationTime is used to generate token for WVD hostpool
# https://docs.microsoft.com/en-us/powershell/module/az.desktopvirtualization/new-azwvdhostpool?view=azps-4.8.0
$ExpirationTime = $((get-date).ToUniversalTime().AddDays(1).ToString('yyyy-MM-ddTHH:mm:ss.fffffffZ'))
Write-Host "$("##vso[task.setvariable variable=ExpirationTime]")$($ExpirationTime)"
@alventech
Copy link
Author

fixed problem with space the old write host had wrong variable with space!
Wrong Write-Host "$("##vso[task.setvariable variable=ExpirationTime]") $($ExpirationTime)"

Correct!
Write-Host "$("##vso[task.setvariable variable=ExpirationTime]")$($ExpirationTime)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment