Hi All
It looks like that there is a Bug in the current Powershell Module (Git Pull):
As you can see, DSSessionKey is still set, but in the Module it wants $DSRefreshToken which has never been set before.
Session is generated by New-DSSession -Credential $creds -BaseURI $Global:dvlsBaseUrl
Removing the 'and' Statement in Invoke-DS.ps1 fixes the Problem and the Token will be refreshed successfully:
Can someone please check that?
Thanks,
Andreas
Hello Andreas,
This part of the script is meant to refresh your oAuth token. To login via oAuth, call 'New-DSSession' without providing the 'Credential' parameter and you should be prompted for your credentials. (Keep in mind this part is not 100% functional yet, as it only works if your default browser is Google Chrome.)
When logged in the 'old' way, your token should automatically refresh itself on each call. If you received an 'Unauthorized', you might need to log in again. If I remember correctly, a session expires after being idle for 7 minutes.
With that being said, 'Get-Variable' errors should be ignored in this case and the script should be able to continue executing. You should then be able to get the result of your call with a proper error message.
If I missed something, please fill in with some more details and I'll further assist you with this issue.
Thank you for your input, I will fix this as soon as possible.
Best regards,
Alexandre Martigny
Hi Alex
Thanks for explaination.
I think the Output could be prevented by adding -ErrorAction SilentlyContinue on the Get-Variable Command.
But the Token Refresh definitively dont work on my side.
After 7 Minutes the Script is not able to connect to the DVLS Server anymore:
Thanks for looking at it!
Best Regards,
Andreas