Set Entry custom image

Set Entry custom image

avatar

Hello,

I need to create Entry with custom image.

I am working with Devolution Server without RDM using New-DSSession cmdlet to authenticate.

I did not find any way have a full customization of an entry, so I would like create by myself additional module that can do more.

I would like to start from image customization using as an example and I need your help. (First step change a folder image)

This is starting code:

New-DSSession -Credential $Creds -BaseURI $DVLSUrl

$Vault = $(Get-DSVaults).Data  | Where-Object {$_.Name -eq "MyVault"}

$DS_tree    = Get-DSEntriesTree -VaultID $Vault.ID

$Folder = $DS_tree.Data.partialConnections | where {$_.Name -eq "MyFolder"}


Note: just for test I manually changed image by RDM and looking at $Folder.customImageId I get the id
If I do the same on a folder with default settings no customImageId property is defined. So it seems that only customized settings are displayed

Now I what to create a new Folder with the same customImageId. How can I do?



All Comments (3)

avatar

Hello,

For the example, do you want it created from the scratch or can an existing folder or template can be used as a start?

Rregards,
Maxime Bernier

avatar

Hello,

Using templates can be a good idea, but I would like to be able in a second time to massive edit objects by script.

Let's start from template!

For folders I just need to customize:

  • Name
  • Description
  • Parent folder
  • MyAppID

Note: MyAppID must be a property of the object that I can set during script creation process. I was thinking to use "Custom Fields"

I have a question: Template have hereditary properties? I mean if I create a new connection starting from a template, what happens if I change the template? Changes will be use only by new object or applied also to old one?

thanks a lot

avatar

Hello,

Here is an example based on a template:

#Obtain template
$templateResponse = Get-DSEntry -EntryId $templateID
$newEntry = $templateResponse.Data

#Remove template fields
$newEntry.repositoryId = $desiredVaultID
$newEntry.templateName = ''

#Modify desired fields
$newEntry.name = 'My new name'
$newEntry.description = 'My new description'
$newEntry.group = 'folderA\subfolderA'
$newEntry.metaInformationData.metaInformation.customField1Value = 'My new app id'

#Create new entry
$newEntryJson = ConvertTo-Json -InputObject $newEntry -Depth 10
New-DSEntryBase -JsonBody $newEntryJson


The template is used to fill values when creating a new entry. There is no hereditary properties.

Regards,
Maxime Bernier