-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_folder_structure.ps1
103 lines (89 loc) · 3.69 KB
/
create_folder_structure.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
param(
# Base directory for all folders
[string]$BaseDir = "D:\",
# Main directories (Personal, Academic, Dev, Music)
[string[]]$MainDirectories = @("Personal", "Academic", "Dev", "Music"),
# Personal Folder Subfolders
[string[]]$PersonalSubfolders = @("Documents", "Photos", "Videos", "Notes"),
# Academic Folder Subfolders and Course Configuration
[string[]]$AcademicSubfolders = @("Courses", "Thesis", "Research"),
[string[]]$Courses = @("Thesis_1_Proposal_Writing", "CS_11_L_Software_Engineering_1"),
[string[]]$CourseSubfolders = @("Lectures", "Assignments", "Exams", "Project"),
# Development Folder Subfolders
[string[]]$DevSubfolders = @("Python", "Web_Development", "Tools", "Learning"),
[string[]]$PythonSubfolders = @("Machine_Learning"),
[string[]]$WebDevSubfolders = @("PHP_Projects", "Astro_Projects"),
# Music Genre Subfolders
[string[]]$MusicGenres = @("Pop", "Jazz")
)
# Function to show loading animation while processing
function Show-LoadingAnimation {
$spinnerChars = @("|", "/", "-", "\")
$counter = 0
$totalItems = $folders.Count + ($Courses.Count * $CourseSubfolders.Count) + ($PythonSubfolders.Count) + ($WebDevSubfolders.Count) + ($MusicGenres.Count) + $MainDirectories.Count
$progressBar = 0
while ($progressBar -lt $totalItems) {
Write-Host -NoNewline "`rProcessing: $($spinnerChars[$counter % 4])"
Start-Sleep -Milliseconds 200
$counter++
$progressBar++
}
Write-Host "`rDone!"
}
# Create Main Directories (Personal, Academic, Dev, Music, etc.)
$folders = @()
foreach ($mainDir in $MainDirectories) {
$mainDirPath = Join-Path $BaseDir $mainDir
$folders += $mainDirPath
# Subfolder creation based on main directory
if ($mainDir -eq "Personal") {
$personalSubfolders = $PersonalSubfolders | ForEach-Object { Join-Path $mainDirPath $_ }
$folders += $personalSubfolders
}
elseif ($mainDir -eq "Academic") {
$academicSubfolders = $AcademicSubfolders | ForEach-Object { Join-Path $mainDirPath $_ }
$folders += $academicSubfolders
# Create course subfolders dynamically
foreach ($course in $Courses) {
$coursePath = Join-Path $mainDirPath "Courses\$course"
$folders += $coursePath
foreach ($subfolder in $CourseSubfolders) {
$folders += Join-Path $coursePath $subfolder
}
}
}
elseif ($mainDir -eq "Dev") {
$devSubfolders = $DevSubfolders | ForEach-Object { Join-Path $mainDirPath $_ }
$folders += $devSubfolders
# Python subfolders
foreach ($subfolder in $PythonSubfolders) {
$folders += Join-Path $mainDirPath "Python\$subfolder"
}
# Web Development subfolders
foreach ($subfolder in $WebDevSubfolders) {
$folders += Join-Path $mainDirPath "Web_Development\$subfolder"
}
}
elseif ($mainDir -eq "Music") {
$musicSubfolders = @(
Join-Path $mainDirPath "Playlists",
Join-Path $mainDirPath "Downloads",
Join-Path $mainDirPath "Podcasts",
Join-Path $mainDirPath "Genre"
)
$folders += $musicSubfolders
# Music genres
$musicGenresPath = Join-Path $mainDirPath "Genre"
foreach ($genre in $MusicGenres) {
$folders += Join-Path $musicGenresPath $genre
}
}
}
# Show loading animation while processing folder creation
Show-LoadingAnimation
# Create the folders
foreach ($folder in $folders) {
New-Item -Path $folder -ItemType Directory -Force
}
# Final message after processing
Write-Host "Folder structure created successfully at $BaseDir"