I am trying to use set-scsmobjecttemplate$CMN11 = Get-SCSMObjectTemplate -DisplayName "CMN11 - Request for Results Notification"$CRClassProjection = get-SCSMTypeProjection System.WorkItem.ChangeRequestProjection$$CRP = Get-SCSMObjectProjection -Projection $CRClassProjection -Filter "Id -eq $CR_ID"Set-SCSMObjectTemplate -Projection $CRP -Template $CMN11PS C:\>>> Set-SCSMObjectTemplate -Projection $CRP -Template $CMN11Set-SCSMObjectTemplate : The template cannot be applied to the instance because the instance is not of the template targets type.At line:1 char:23+ Set-SCSMObjectTemplate <<<< -Projection $CRP -Template $CMN11 + CategoryInfo : InvalidOperation: (Template_ae893e...2e7f27753abdbe3:ManagementPackObject Template) [Set-SCSMObjectTemplate], InvalidOperationException + FullyQualifiedErrorId : ApplyTemplate,SMLets.SetSCSMObjectTemplateCommand And I think this is the cause, PS C:\>>> $CRP = Get-SCSMObjectProjection -Projection $CRClassProjection -Filter "Id -eq $CR_ID"PS C:\>>> $CRP.GetType()IsPublic IsSerial Name BaseType-------- -------- ---- --------True False PSCustomObject System.Object PS C:\>>> $CRClassProjection.GetType()IsPublic IsSerial Name BaseType-------- -------- ---- --------True False PSCustomObject System.ObjectAnd according to the cmdlet help, we are looking for a specific type of object, PS C:\>>> help Set-SCSMObjectTemplateNAME Set-SCSMObjectTemplateSYNTAX Set-SCSMObjectTemplate [-Projection] [-Name ] [-Tem plate ] [-ComputerName ] [-Credential ] [-SCSMSe ssion ] [-Verbose] [-Debug] [-ErrorAction ] [-WarningAc tion ] [-ErrorVariable ] [-WarningVariable ] [-OutVariable ] [-OutBuffer ] [-WhatIf] [-Confirm] Set-SCSMObjectTemplate [-Object] [-Name ] [-Template ] [-ComputerName ] [-Credential ] [-SCSMSession ] [-Verbose] [-Debug] [-ErrorAction ] [-WarningAction ] [-ErrorVariable ] [-WarningVariable ] [-OutVariable ] [-OutBuffer ] [-WhatIf] [-Confirm]
Comments: Incorrect usage of cmdlet
Comments: Incorrect usage of cmdlet