This commit is contained in:
Srđan Božović
2018-08-21 09:58:51 +02:00
parent 7cf6140ddc
commit e9eb4bde10
@@ -12,9 +12,9 @@ function Ensure-Login ()
If($context.Subscription -eq $null)
{
Write-Host "Loging in ..."
If((Login-AzureRmAccount -ErrorAction SilentlyContinue) -eq $null)
If((Login-AzureRmAccount -ErrorAction SilentlyContinue -ErrorVariable $error) -eq $null)
{
Write-Host "Login failed: $_" -ForegroundColor Red
Write-Host "Login failed: $error" -ForegroundColor Red
Exit
}
}