modified: RdzeN-Profile.ps1

modified:   functions/Override-Profile.ps1
	modified:   functions/Reload-Profile.ps1
	modified:   functions/Test-Profile.ps1
This commit is contained in:
Tomasz Kostrzewa 2024-03-05 19:17:58 +01:00
parent 0010dd1979
commit 94499ff700
4 changed files with 6 additions and 29 deletions

View File

@ -45,29 +45,9 @@ Get-ChildItem $path_gitea_powershell_profile_functions | ForEach-Object {
. $_.FullName . $_.FullName
} }
# 96. Update Profile Section: # 97. Test Profile
if (-not (Test-Path $PROFILE)) { Test-Profile
# 97. Test Profile # 98. Override Profile
Test-Profile Override-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 # 99. Reload Profile
do { Reload-Profile
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
}

View File

@ -3,6 +3,5 @@
function Override-Profile { function Override-Profile {
if ((Test-Path $PROFILE)) { if ((Test-Path $PROFILE)) {
Get-Content "$path_gitea_powershell_profile\RdzeN-Profile.ps1" | Set-Content $PROFILE -Force Get-Content "$path_gitea_powershell_profile\RdzeN-Profile.ps1" | Set-Content $PROFILE -Force
New-SimulateTyping "Your PowerShell profile was Override!"
} }
} }

View File

@ -2,5 +2,4 @@
# Reload $profile # Reload $profile
function Reload-Profile { function Reload-Profile {
. $PROFILE . $PROFILE
} }
New-SimulateTyping "Your PowerShell profile was Reloaded!"

View File

@ -3,6 +3,5 @@
function Test-Profile { function Test-Profile {
if (-not (Test-Path $PROFILE)) { if (-not (Test-Path $PROFILE)) {
Copy-Item -Path "$path_gitea_powershell_profile\RdzeN-Profile.ps1" -Destination $PROFILE -force Copy-Item -Path "$path_gitea_powershell_profile\RdzeN-Profile.ps1" -Destination $PROFILE -force
New-SimulateTyping "Your PowerShell profile was created!"
} }
} }