Set CreationSource property

A new feature of DSM 2017.1 is that objects have a CreationSource property whose value is intended to provide information about the source through which the object was created. By default, all objects that you create using PSX are therefore created with the value PSX7/PowerShell for this property..


Examples:


Hint: The execution of these examples requires a connected PowerShell drive.


Wenn Sie für den Wert der Eigenschaft etwas anderes angeben möchten, beispielsweise um das jeweilige Script näher zu bezeichnen, dann lässt sich das erreichen, indem man den New-Emdb...-Cmdlets einen -PropertyList-Parameter mitgibt, dem man einen Wert für CreationSource für das neue Objekt mitgeben kann:


If you want to specify something else for the value of the property, for example, to specify the script which created the object, you can do this by giving the New-Emdb... cmdlet a -PropertyList-parameter, where you can specify a value for CreationSource for the new object:


New-EmdbComputer "WIN10-01" -PropertyList @{CreationSource = "PSX7/MyScript"}


Alternatively, you can also specify the value by first only creating the new object in memory using the New-Item cmdlet and the DelayCreation switch, then setting the property, and finally creating the object using the Create()-method:


$MyNewComputer = New-Item "WIN10-02" -ItemType Computer -DelayCreation

$MyNewComputer.CreationSource = "PSX7/MyScript"

$MyNewComputer.Create()


The value of the property can be set globally on a BlsEmdb drive:


$MyDrive = Get-EmdbDrive "emdb"

$MyDrive.DefaultCreationSource = "PSX7/Integration"

$MyNewComputer = New-EmdbComputer "WIN10-03"