#                                                                                                               
#          `B$$$$$$$$&r<.       !* .$"                                                                         
#         .xccccczW$$$$$%'   .  !* .$"    ......       ...    .........   ......         .........   ...       
#        `<}{i.    .#$$$$"   $: !* .$"   '$$$$$$$W1'  .$$$.  "$$$$$$$$|   $$$$$$@c]`    `$$$$$$$$*   $$$"      
#       ,uuuuu"    .&$$$j    $: !* .$"   '$$$..`[$$&  .$$$.  "$$$`````'   $$$;`"<*$$/.  `$$$^`````   $$$"      
#       .l??!' .'"-8@v]^     $: !* .$"   '$$$   ,$$W  .$$$.  "$$$'''''.   $$$`    f$$\  `$$$`'''''   $$$"      
#     `%$$$$I I$$$$$\        $: !* .$"   '$$$#MB$&{.  .$$$.  "$$$$$$$$|   $$$`    ,$$$  `$$$$$$$$*   $$$"      
#    ^B$$$$>   "B$$$$n.      $: !* .$"   '$$$,@$8`    .$$$.  "$$$'''''.   $$$`    ~$$M  `$$$`'''''   $$$"      
#   "@$$$$+     'W$$$$z.     $: !* .$"   '$$$ `%$@:   .$$$.  "$$@         $$$`  .!@$@^  `$$$         $$$"      
#  ,$$$$$+       .v$$$$W`    $: !* .$"   '$$$  'W$$?  .$$$.  "$$$vvvvv?   $$$*z8$$@|'   `$$$cvvvv/   $$$#vvvv> 
# '[}}}};          _}}}}].   }` !* .}'   .~~<   .<~~^  ~~~   '~~~~~~~~,   ~~~~~>:`      .~~~~~~~~I   <~~~~~~~" 
#                               !*                                                                             
#                               !*                                                                             
#                               !*                                                                             
#                               !*                                                                             
#                               `;   

# This is a script to create the folder structure requiered for the commercial invoice folder 

# Define the base folder path
$basePath = "C:\Users\nicholson\Riedel Communications GmbH & Co. KG\DEP - Australia Internal - Documents\Operations\Freight\Commercial Invoices 2025"

# Define folder structure as a hashtable
$folderStructure = @{
    "001 Repairs" = @("001 January", "002 February", "003 March", "004 April", "005 May", "006 June", "007 July", "008 August", "009 September", "010 October", "011 November", "012 December")
    "002 Rental" = @("001 January", "002 February", "003 March", "004 April", "005 May", "006 June", "007 July", "008 August", "009 September", "010 October", "011 November", "012 December")
    "003 Sales" = @("001 January", "002 February", "003 March", "004 April", "005 May", "006 June", "007 July", "008 August", "009 September", "010 October", "011 November", "012 December")
    "004 Demo" = @("001 January", "002 February", "003 March", "004 April", "005 May", "006 June", "007 July", "008 August", "009 September", "010 October", "011 November", "012 December")
}

# Ensure the base folder exists
if (-not (Test-Path -Path $basePath)) {
    New-Item -Path $basePath -ItemType Directory -Force
}

# Create folders and subfolders
foreach ($folder in $folderStructure.Keys) {
    # Create main subfolder
    $subFolderPath = Join-Path -Path $basePath -ChildPath $folder
    if (-not (Test-Path -Path $subFolderPath)) {
        New-Item -Path $subFolderPath -ItemType Directory -Force
    }

    # Create sub-subfolders
    foreach ($subSubFolder in $folderStructure[$folder]) {
        $subSubFolderPath = Join-Path -Path $subFolderPath -ChildPath $subSubFolder
        if (-not (Test-Path -Path $subSubFolderPath)) {
            New-Item -Path $subSubFolderPath -ItemType Directory -Force
        }
    }
}

Write-Host "Folders and subfolders created successfully!"