For the complete documentation index, see llms.txt. This page is also available as Markdown.

Esempi PowerShell - creazione della struttura di cartelle da un file CSV

Tenga presente che il file CSV deve essere codificato in UTF-8 per supportare i caratteri speciali.

Questo esempio crea una struttura di cartelle di gruppo da un file CSV.

Esempio

$csv = Import-Csv "c:\YourFolder\GroupFolder.csv"

foreach ($csvEntry in $csv) {
        $groupName = $csvEntry.Name

    # Extract the group folder name
    if ($groupName.Contains("\")) {
         $groupName = $groupName.Substring($groupName.LastIndexOf("\"), $groupName.Length - $groupName.LastIndexOf("\"))
         $groupName = $groupName.TrimStart("\")
        }

    # Create the group folder if it is not null, empty or fill in with space characters
    if (![]::IsNullOrWhiteSpace($groupName)) {
        $session = New-RDMSession -Type "Group" -Name $groupName
        $session.Group = $csvEntry.Name
        Set-RDMSession $session
        Write-Host "Group Folder $groupName created" -f Yellow
        }
}

Update-RDMUI

Note

Il file CSV deve avere una sola colonna con il titolo impostato su Name.

Il percorso completo deve essere specificato per ogni sottocartella.

Ecco un esempio di questo file CSV:

Ultimo aggiornamento

È stato utile?