Skip to main content

Extract nom de dossier

 

# Get the folder names
$directory = "C:\Path\to\Directory"
$folderNames = Get-ChildItem -Path $directory -Directory | Select-Object -ExpandProperty Name
 
# Specify the output file path
$outputFilename = "C:\Path\to\output.csv"
 
# Export the folder names to CSV
$folderNames | Export-Csv -Path $outputFilename -NoTypeInformation
 
Write-Host "Folder names exported to $outputFilename."