Not having much luck with this one, any help much appreciated!
$RA_ID = "RA612"
$RAClass = get-SCSMClass -name System.WorkItem.Activity.ReviewActivity$
$ParentCR = Get-SCSMRelationshipObject -Target $RAClass | ?{$_.TargetObject -match $RA_ID}
returns this error,
Get-SCSMRelationshipObject : Object reference not set to an instance of an object.
At line:12 char:39
+ $ParentCR = Get-SCSMRelationshipObject <<<< -Target $RAClass | ?{$_.TargetObject -match $RA_ID}
+ CategoryInfo : InvalidOperation: (SMLets.GetSCSMRelationshipObjectCommand:GetSCSMRelationshipObjectCommand) [Get-SCSMRelationshipObject], NullReferenceEx
ception
+ FullyQualifiedErrorId : RelationshipQuery,SMLets.GetSCSMRelationshipObjectCommand
This is where is it seems to go wrong,
Get-SCSMRelationshipObject -Target $RAClass
PS H:\> Get-SCSMRelationshipObject -Target $RAClass
Get-SCSMRelationshipObject : Object reference not set to an instance of an object.
At line:1 char:27
+ Get-SCSMRelationshipObject <<<< -Target $RAClass
+ CategoryInfo : InvalidOperation: (SMLets.GetSCSMRelationshipObjectCommand:GetSCSMRelationshipObjectCommand) [Get-SCSMRelationshipObject], NullReferenceEx
ception
+ FullyQualifiedErrorId : RelationshipQuery,SMLets.GetSCSMRelationshipObjectCommand