big-data-for-humans / azure-automation-tools

Set of tools for Azure Automation
MIT License
0 stars 0 forks source link

Issue: Export-AatAutomationRunbookLog errors when no logs are present #23

Open stvnrs opened 7 years ago

stvnrs commented 7 years ago

Steps to recreate

$Params = @{
    ResourceGroupName ='a-resource-group'
    AutomationAccountName = 'an-automation-account'    
    StorageAccountName =  'storageaccountname'
    StorageContainerName = 'containername' 
    IncludeRunbook =  'RunBookName'          
}

Export-AatAutomationRunbookLog @Params

Expected behaviour

Cmdlet reports nothing to log and continues without error.

Collecting jobs data...
Nothing to log.
Collecting jobs data... Done.

Actual behaviour

An exception is thrown.

Collecting jobs data...
Collecting jobs data... Done.
Export-AzureRmAutomationRunbookLog : The property 'Count' cannot be found on this object. Verify that the property exists.
At line:11 char:1
+ Export-AzureRmAutomationRunbookLog @Params
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Export-AzureRmAutomationRunbookLog], PropertyNotFoundException
    + FullyQualifiedErrorId : PropertyNotFoundStrict,Export-AzureRmAutomationRunbookLog

Environment data

Host

Name             : Windows PowerShell ISE Host
Version          : 5.1.14393.1066
InstanceId       : 1ab6ae7a-2f9f-46fa-b484-7cec26ba3726
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-GB
CurrentUICulture : en-GB
PrivateData      : Microsoft.PowerShell.Host.ISE.ISEOptions
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

PSVersion

Name                           Value
----                           ----
PSVersion                      5.1.14393.1066
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.1066
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Modules

Name                            Version
----                            -------
Azure.Storage                   2.8.0  
AzureAutomationTools.Logging    0.1    
AzureRM.Automation              2.8.0  
AzureRM.profile                 2.8.0  
AzureRM.Resources               3.8.0  
AzureRM.Sql                     2.8.0  
AzureRM.Storage                 2.8.0  
ISE                             1.0.0.0
Microsoft.PowerShell.Management 3.1.0.0
Microsoft.PowerShell.Security   3.0.0.0
Microsoft.PowerShell.Utility    3.1.0.0
Microsoft.WSMan.Management      3.0.0.0
splattyps                       0.1