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

New Post: Add property to objecttemplate using Add()

$
0
0
Hi,

I'm trying to update an objecttemplate via powershell smlets, but can't figure out the correct input values for the add method.

Here is the script:
Import-Module smlets

$template = Get-SCSMObjectTemplate -DisplayName "Company - Service - New Hardware with approval"

$template.PropertyCollection.Add("what is the correct parameter value here?") 
The overloaddefinition says:
void Add(Microsoft.EnterpriseManagement.Configuration.ManagementPackObjectTemplateProperty item)
void ICollection[ManagementPackObjectTemplateProperty].Add(Microsoft.EnterpriseManagement.Configuration.ManagementPackObjectTemplateProperty item)
int IList.Add(System.Object value)

How do I create a objecttemplateproperty item ?

The propertycollection on the template contains the following:
Path                                                                                            MixedValue                                                                                    
----                                                                                            ----------                                                                                    
$Context/Property[Type='CustomSystem_WorkItem_ServiceRequest_Library!System.WorkItem.Service... $MPElement[Name='CustomServiceManager_ServiceRequest_Library!ServiceRequestPriorityEnum.Low']$
$Context/Property[Type='CustomSystem_WorkItem_ServiceRequest_Library!System.WorkItem.Service... $MPElement[Name='CustomServiceManager_ServiceRequest_Library!ServiceRequestUrgencyEnum.Low']$ 
$Context/Property[Type='CustomSystem_WorkItem_ServiceRequest_Library!System.WorkItem.Service... $MPElement[Name='CustomServiceManager_ServiceRequest_Library!ServiceRequestSourceEnum.Porta...
$Context/Property[Type='CustomSystem_WorkItem_ServiceRequest_Library!System.WorkItem.Service... $MPElement[Name='CustomServiceManager_ServiceRequest_Library!ServiceRequestAreaEnum.Hardwar...
$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/Title$                  New Hardware Request with Approval                                            
An example of this would be nice, thanks :)

Viewing all articles
Browse latest Browse all 306

Trending Articles



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