Closed AndyHerb closed 5 years ago
@viverm Hey Vipin, would you mind taking a look at this issue?
looking in it.
hi AndyHerb
can you try passing the date in string "MM/dd/yyyy hh:mm:ss AM"
PS C:\Users\viverm> Get-AzureRmRecoveryServicesAsrEvent -StartTime "5/18/2018 2:05:00 AM" -EndTime "5/23/2018 2:21:47 PM"| select TimeOfOccurence,eventCode
TimeOfOccurence EventCode
5/23/2018 2:01:00 PM EA0430 5/23/2018 1:24:27 PM EA0431 5/23/2018 12:58:55 PM EA0430 5/23/2018 12:23:23 PM EA0431 5/23/2018 12:06:46 PM InMageCommon_ECH0003 5/23/2018 12:06:17 PM SRSMasterTargetHealthChanged 5/23/2018 11:50:37 AM InMageCommon_ECH0003 5/23/2018 11:50:37 AM InMageCommon_ECH0001 5/23/2018 11:50:37 AM InMageCommon_ECH0007 5/23/2018 11:50:25 AM InMageCommon_ECH0001 5/23/2018 11:49:57 AM SRSMasterTargetHealthChanged 5/23/2018 11:49:57 AM MasterTargetMobilityAgentServiceHeartbeat 5/23/2018 11:26:09 AM EA0430 5/23/2018 10:50:43 AM EA0431 5/23/2018 10:23:35 AM SRSDRAHeartbeatMissing
That doesn't seem to have resolved anything unfortunately
PS C:\> $DebugPreference = "Continue"
PS C:\> Get-AzureRmRecoveryServicesAsrEvent -StartTime "5/18/2018 2:05:00 AM" -EndTime "5/23/2018 2:21:47 PM" -Debug
Get-AzureRmRecoveryServicesAsrEvent : Cannot bind parameter 'StartTime'. Cannot convert value "5/18/2018 2:05:00 AM" to type "System.DateTime". Error: "String was not recognized as a valid DateTime."
At line:1 char:48
+ ... eRmRecoveryServicesAsrEvent -StartTime "5/18/2018 2:05:00 AM" -EndTim ...
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-AzureRmRecoveryServicesAsrEvent], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.Azure.Commands.RecoveryServices.SiteRecovery.GetAzureRmRecoveryServicesAsrEvents
Interestingly, the below does work:
PS C:\> [datetime]"5/18/2018 2:05:00 AM"
18 May 2018 02:05:00
@cormacpayne can you help with this . Autoboxing of date from above "5/18/2018 2:05:00 AM" is not happening in andyherb's PS but working fine in mine
$PSVersionTable.psVersion 5.1.17134.228
Closing as the issue could not be reproduced and there has been no activity for the past 1 year
Description
Get-AzureRmRecoveryServicesAsrEvents appears not to work when you provide a value for the StartTime or EndTime parameters. This appears to be the case whether a text date is provided, or a datetime object.
Script/Steps for Reproduction
Module Version
AzureRM 6.1.0
Environment Data
PSVersion 5.1.17134.48 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.17134.48 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1
Debug Output
Resolve-AzureRmError Output