I am using PowerShell to run a script against TFS, and from time to time the application gets stuck (there is no possibility to stop because the button is grayed out) and I need to re-open the application. the question is why it could happen and how to release it and maybe add a protection is required.
I am using this module: Az.Accounts
$null = Connect-AzAccount -ErrorAction Stop -WarningAction SilentlyContinue
$accessToken = (Get-AzAccessToken -ErrorAction Stop).Token
This will pop up a window for Azure, when it passes this the connection to TFS succeded
I am using this module for connecting to TFS: VSTeam
The root cause is the pop-up, I used the same module in the past but differently and it worked perfectly every time:
[PSCredential]$creds = Get-Credential
$null = Connect-AzAccount -Credential $creds -ErrorAction Stop -WarningAction SilentlyContinue
4