modified: RdzeN-Profile.ps1

This commit is contained in:
Tomasz Kostrzewa 2024-03-06 19:20:40 +01:00
parent 41fad4267b
commit 35b2a96da9

View File

@ -3,6 +3,9 @@
# Example Powershell Profile.
#
# TO-DO
# Step 0, precheck for git, notepad++ and vscode installed.
# 1. Check if GITEA folder exists.
$path_gitea = "$($env:USERPROFILE)\GITEA"
$path_gitea_powershell_profile = "$path_gitea\PowerShell-Profile"
@ -75,9 +78,9 @@ Get-ChildItem $path_to_search | ForEach-Object {
$found_functions = @()
Get-ChildItem $path_to_search | ForEach-Object {
$file_content = Get-Content $_.FullName -Raw
$matches = [Regex]::Matches($file_content, '(?<=function\s).*?(?={)')
foreach ($match in $matches) {
$found_functions += $match.Value.Trim()
$matched_functions = [Regex]::Matches($file_content, '(?<=function\s).*?(?={)')
$matched_functions | ForEach-Object {
$found_functions += $_.Value.Trim()
}
}
$found_functions = $found_functions | Sort-Object
@ -92,7 +95,7 @@ $profile_repo = Get-Content "$path_gitea_powershell_profile\RdzeN-Profile.ps1"
$profile_system = Get-Content $PROFILE
$compare_profile = Compare-Object -ReferenceObject $profile_repo -DifferenceObject $profile_system
# 6. Override actual profile and reload it if needed.
# 7. Override actual profile and reload it if needed.
if ($compare_profile.sideindicator.count -gt 0) {
Override-Profile
Reload-Profile