Hi,
I wanted to set a dateTime value into the TargetResolutionTime of an incident. This fails always with an error message (see below).
I use the SMLets Beta 3 and SCSM2010 SP1 CU2.
Since I'm able to update other fields and I'm sure I used a dateTime value, I guess it is a bug in the SMLets.
But may be I'm wrong. In that case please let me know.
BTW: I also used (Get-Date) to set the dateTime value.
Thanks for your help
Oliver
--- snip ---
PS D:\SCSMscripts> Get-SCSMObject -Class (Get-SCSMClass System.WorkItem.Incident$) -Filter "ID -eq IR164" | Set-SCSMObject -debug -PropertyHashtable @{ TargetResolutionTime = [datetime]::now }
DEBUG: Attempting to find property TargetResolutionTime
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"):
DEBUG: PROPERTY TargetResolutionTime == TargetResolutionTime Result: 0
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"):
DEBUG: Assigning 17/06/2011 12:32:36 to TargetResolutionTime
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"):
VERBOSE: Want to set TargetResolutionTime(datetime) to 17/06/2011 12:32:36
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"):
Confirm
Simple object value was not the proper type.
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"):
Set-SCSMObject : Simple object value was not the proper type.
At line:1 char:104
+ Get-SCSMObject -Class (Get-SCSMClass System.WorkItem.Incident$) -Filter "ID -eq IR164" | Set-SCSMObject <<<< -debug
-PropertyHashtable @{ TargetResolutionTime = [datetime]::now }
+ CategoryInfo : ObjectNotFound: (17/06/2011 12:32:36:DateTime) [Set-SCSMObject], InvalidSimpleObjectValu
eException
+ FullyQualifiedErrorId : Could not assign date ,SMLets.SetSMObjectCommand
VERBOSE: Adding 9d0b4646-5f78-0988-e59d-7093509cb7b6 to change list
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"):
Confirm
Are you sure you want to perform this action?
Performing operation "Set-SCSMObject" on Target "SMObjects".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
PS D:\SCSMscripts>
--- snap ---
Comments: ** Comment from web user: FreemanRU **
I wanted to set a dateTime value into the TargetResolutionTime of an incident. This fails always with an error message (see below).
I use the SMLets Beta 3 and SCSM2010 SP1 CU2.
Since I'm able to update other fields and I'm sure I used a dateTime value, I guess it is a bug in the SMLets.
But may be I'm wrong. In that case please let me know.
BTW: I also used (Get-Date) to set the dateTime value.
Thanks for your help
Oliver
--- snip ---
PS D:\SCSMscripts> Get-SCSMObject -Class (Get-SCSMClass System.WorkItem.Incident$) -Filter "ID -eq IR164" | Set-SCSMObject -debug -PropertyHashtable @{ TargetResolutionTime = [datetime]::now }
DEBUG: Attempting to find property TargetResolutionTime
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"):
DEBUG: PROPERTY TargetResolutionTime == TargetResolutionTime Result: 0
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"):
DEBUG: Assigning 17/06/2011 12:32:36 to TargetResolutionTime
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"):
VERBOSE: Want to set TargetResolutionTime(datetime) to 17/06/2011 12:32:36
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"):
Confirm
Simple object value was not the proper type.
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"):
Set-SCSMObject : Simple object value was not the proper type.
At line:1 char:104
+ Get-SCSMObject -Class (Get-SCSMClass System.WorkItem.Incident$) -Filter "ID -eq IR164" | Set-SCSMObject <<<< -debug
-PropertyHashtable @{ TargetResolutionTime = [datetime]::now }
+ CategoryInfo : ObjectNotFound: (17/06/2011 12:32:36:DateTime) [Set-SCSMObject], InvalidSimpleObjectValu
eException
+ FullyQualifiedErrorId : Could not assign date ,SMLets.SetSMObjectCommand
VERBOSE: Adding 9d0b4646-5f78-0988-e59d-7093509cb7b6 to change list
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"):
Confirm
Are you sure you want to perform this action?
Performing operation "Set-SCSMObject" on Target "SMObjects".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
PS D:\SCSMscripts>
--- snap ---
Comments: ** Comment from web user: FreemanRU **
Fixed in beta 5