Skip to content

Commit 82ad7a1

Browse files
committed
SAVEPOINT
1 parent ed13f6b commit 82ad7a1

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

PSProfile/Public/Configuration/Start-PSProfileConfigurationHelper.ps1

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,39 @@ function Start-PSProfileConfigurationHelper {
380380
until ($decision -notmatch "[Yy]")
381381
}
382382
7 {
383-
383+
if ($Global:PSProfile.ProjectPaths.Count) {
384+
.$current(($Global:PSProfile.ProjectPaths -join ", "))
385+
}
386+
Write-Host "Would you like to add an additional Project Path to your PSProfile?"
387+
$decision = Read-Host "[Y] Yes [N] No [X] Exit"
388+
do {
389+
switch -Regex ($decision) {
390+
"[Yy]" {
391+
$item1 = Read-Host "Please enter the path to the additional project folder"
392+
if ($null -eq (Get-PSProfileProjectPath -Name $item1)) {
393+
if (-not $changeHash.ContainsKey('Project Paths')) {
394+
$changes.Add("Project Paths:")
395+
$changeHash['Project Paths'] = @()
396+
}
397+
.$command("Add-PSProfileProjectPath -Name '$item1'")
398+
Add-PSProfileProjectPath -Name $item1 -Verbose
399+
$changes.Add(" - $item1")
400+
$changeHash['Project Paths'] += $item1
401+
}
402+
else {
403+
.$warning("Project Path '$item1' already exists on your PSProfile configuration! If you would like to overwrite it, run the following command:")
404+
.$command("Add-PSProfileProjectPath -Name '$item1' -Force")
405+
}
406+
"`nWould you like to add another Project Path to your PSProfile?" | Write-Host
407+
$decision = Read-Host "[Y] Yes [N] No [X] Exit"
408+
}
409+
"[Xx]" {
410+
"`nExiting Configuration Helper!`n" | Write-Host -ForegroundColor Yellow
411+
return
412+
}
413+
}
414+
}
415+
until ($decision -notmatch "[Yy]")
384416
}
385417
8 {
386418

0 commit comments

Comments
 (0)