modified: RdzeN-Profile.ps1
modified: functions/Reload-Profile.ps1
This commit is contained in:
parent
8889612260
commit
2aea742524
@ -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
|
||||
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
|
||||
}
|
||||
|
@ -3,4 +3,4 @@
|
||||
function Reload-Profile {
|
||||
. $PROFILE
|
||||
}
|
||||
New-SimulateTyping "Your PowerShell profile was reloaded!"
|
||||
New-SimulateTyping "Your PowerShell profile was Reloaded!"
|
Loading…
x
Reference in New Issue
Block a user