How can I get the template GUID or name that is applied to a request offering?
I am trying to get the template name or guid that is assigned to a request offering through PowerShell.
Any suggestions as to how I can go about this?
Thank you.
Here is what I have so far.
Best Answer
-
Justin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭This might be the long way around, but it works for me:
$template = $requestOffiring.Values | ?{$_.type -like '*targettemplate*'} | select -expandproperty value$templateName = $template.Split("|")[3]$templateObject = Get-SCSMObjectTemplate -Name $templateName$templateObject1
Answers
(Get-SCSMRelationshipObject -BySource $SRObject | Where-Object {$_.RelationshipID -eq $($WorkitemRelatesToRequestOffering.id) }).sourceobject
You have to wrap $WorkitemRelatesToRequestOfffering.id in $() to capture the actual value.
$template = $requestOffiring.Values | ?{$_.type -like '*targettemplate*'} | select -expandproperty value