From 2aea7425248d6e8276f47b543281621cbffd96d8 Mon Sep 17 00:00:00 2001 From: Tomasz Kostrzewa Date: Tue, 5 Mar 2024 18:57:05 +0100 Subject: [PATCH] modified: RdzeN-Profile.ps1 modified: functions/Reload-Profile.ps1 --- RdzeN-Profile.ps1 | 29 +++++++++++++++++++++++++---- functions/Reload-Profile.ps1 | 2 +- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/RdzeN-Profile.ps1 b/RdzeN-Profile.ps1 index 5d5556e..ced5280 100644 --- a/RdzeN-Profile.ps1 +++ b/RdzeN-Profile.ps1 @@ -3,7 +3,6 @@ # Example Powershell Profile. # # 1. Check if GITEA folder exists. - $path_gitea = "$($env:USERPROFILE)\GITEA" $path_gitea_powershell_profile = "$path_gitea\PowerShell-Profile" $path_gitea_powershell_profile_functions = "$path_gitea_powershell_profile\functions" @@ -19,7 +18,6 @@ if (-not (Test-Path $path_gitea_powershell_profile_functions )) { } # 2. Download / pull GIT REPO - $RepositoryURL = "https://gitea.rdzen.net/najlepszytomasz/PowerShell-Profile.git" if (-not (Get-ChildItem $path_gitea_powershell_profile_functions).count -gt 0) { @@ -43,10 +41,33 @@ if (-not (Get-ChildItem $path_gitea_powershell_profile_functions).count -gt 0) { } # 3. dot source functions. - Get-ChildItem $path_gitea_powershell_profile_functions | ForEach-Object { . $_.FullName } +# 96. Update Profile Section: +if (-not (Test-Path $PROFILE)) { + # 97. Test Profile + Test-Profile +} else { + # 98. Override Profile + do { + New-SimulateTyping "Do you want to Override your PS Profile?" + $reload = Read-Host "Type [Y]es or [N]o" + } until ( + $reload -in ("Y","N") + ) + if ($reload -eq "Y") { + Override-Profile + } +} # 99. Reload Profile -Reload-Profile \ No newline at end of file +do { + New-SimulateTyping "Do you want to Reload your PS Profile?" + $reload = Read-Host "Type [Y]es or [N]o" +} until ( + $reload -in ("Y","N") +) +if ($reload -eq "Y") { + Reload-Profile +} diff --git a/functions/Reload-Profile.ps1 b/functions/Reload-Profile.ps1 index c5722a1..ce6a83c 100644 --- a/functions/Reload-Profile.ps1 +++ b/functions/Reload-Profile.ps1 @@ -3,4 +3,4 @@ function Reload-Profile { . $PROFILE } -New-SimulateTyping "Your PowerShell profile was reloaded!" \ No newline at end of file +New-SimulateTyping "Your PowerShell profile was Reloaded!" \ No newline at end of file