user10189172
user10189172

Reputation:

Characters not allowed with powershell in the Cireson smlets Get-SCSMEnumeration

I am trying to import a enum list into this Service Manager Cireson Asset tool.

Import-Module smlets
$mpName = "CompanyName.ListValues.HWA.CatalogModels"
$enum = Get-SCSMEnumeration -Name Cireson.AssetManagement.CatalogItemModelEnum$
$types = Import-Csv -Path "E:\AssetFiles\Models.csv"

$mp = New-SCSMManagementPack -ManagementPackName $mpName -FriendlyName $mpName -DisplayName $mpName -PassThru

foreach ($t in $types) {

    #Add-SCSMEnumeration -Parent $enum -Name ($enum.Name + "." + $t.Model.Replace(' ','')) -DisplayName $t.Model -Ordinal 10 -ManagementPack $mp

    Add-SCSMEnumeration -Parent $enum -Name ($enum.Name + "." + $t.Model.Replace(' ','')) -DisplayName $t.Model -ManagementPack $mp

}
  1. Seems that Ordinal: is prompted when I do not include it, must be built into the SCSM import module ?
  2. It seems to skip some records that are the same, why?
  3. Doesn't like certain characters?

The 'ID' attribute is invalid - The value 'Cireson.AssetManagement.CatalogItemModelEnum.Intel(R)Xeon(R)[email protected]' is invalid according to its datatype 'ManagementPackUniqueIdentifier' - The Pattern constraint failed. ---> System.Xml.Schema.XmlSchemaException: The Pattern constraint failed.

data in the csv file looks like the following: "Model" is the column header

Model
HP DL320p Gen 8 
ProLiant BL460c G7
ProLiant BL460c G1
ProLiant BL460c G1
ProLiant BL460c G1
ProLiant BL460c Gen8
Intel(R) Xeon(R) CPU E5640 @ 2.67GHz 
Intel(R) Xeon(R) CPU X5670 @ 2.93GHz 

Upvotes: 0

Views: 125

Answers (0)

Related Questions