Error: Could not find ADLA Account in any resource group - DataLakeStoreGen1

I am executing ADLA commands from Power shell through Azure Certificate authentication from SSIS package. Powershell Version is 4.0 and DataLake Store is Gen1. When executing the SSIS package-often I am seeing the error below but not always. Kind of this behavior I am seeing when Datalake Store we are using has become Gen1 after preview release of Gen2. Can any one help me why I am seeing this and what could be the reason?

System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials;
Login-AzureRmAccount -ServicePrincipal -TenantId 'Tenant'  -ApplicationId 'ApplicationID' -CertificateThumbprint  'Certificate' -ErrorAction Stop > $null ; 
$Status = Get-AzureRmDataLakeAnalyticsAccount -Name 'ADLAccount'
-ErrorAction Stop -ErrorVariable ErrorStatus;
if($Status.State -ne 'Active'){
Write-Error ('Error Occurred while connecting to DataLake analytics account::ADLAAccount');}
Write-Error ($_.Exception.Message +';'+ $_.InvocationInfo.PositionMessage);
 : Could not find account: 'ADLAAccount' in any resource group in the 
currently selected subscription: subscriprionID. Please 
ensure this account exists and that the current user has access to it.;At 'AppID' -CertificateThumbprint 'Thumbprint' -ErrorAction Stop > $null ;