Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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