Creating a nested folder structure with Powershell

Creating a nested folder structure with Powershell

avatar

I'm in the process of automating our RDM SQL Database by fetching data from an Oracle DB inventory and transforming it into RDM Session objects.

The issue I run into is create subfolders. Let's say I want to create a folder for each customer and then a subfolder for their branch offices, so:

- ACME
---- Amsterdam
---- Brussels
---- Berlin
---- London
---- Paris


If I do

new-rdmsession -Type "Group" -Name "ACME"


I will get my folder on the first level alright. But on the second level, things go wrong. According to old documentation (your cmdlets are great but not very well documented), one can use

new-rdmsession -Type "Group" -Name "ACME\Amsterdam"


The interesting result is that I then get the following:

- ACME
---- ACME\Amsterdam
---- ACME\Brussels
---- ACME\Berlin
---- ACME\London
---- ACME\Paris


This happens independent of ACME already existing or not. It's a step in the right direction, but not entirely right. Am I doing something wrong or is this a bug? Using RDM Enterprise 2022.2.20.0 x64 by the way.

Thank you in advance.

All Comments (3)

avatar

Hello,

You are missing the -Group parameter to tell the cmdlet in which folder to create the new folder.

In your example, you would need to use the following:

New-RDMSession -Type "Group" -Name "Amsterdam" -Group "ACME" -SetSession


Please note the Group parameter is case sensitive. If you put Acme instead, it would create a virtual folder named Acme and create the folder inside.

Best regards,

Richard Boisvert

avatar

Hello Richard and thanks, that works. Somehow my previous reply seems to be gone? I had answered last week already.

avatar

Hello,

Glad it fixed your issue!

Best regards,

Richard Boisvert