Quantcast
Channel: SCSM PowerShell Cmdlets
Viewing all articles
Browse latest Browse all 306

New Post: Trying to get the parent CR of a review activity...

$
0
0

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


Viewing all articles
Browse latest Browse all 306

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>