diff --git a/RdzeN-Profile.ps1 b/RdzeN-Profile.ps1 index 4bcf275..08bbc0e 100644 --- a/RdzeN-Profile.ps1 +++ b/RdzeN-Profile.ps1 @@ -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,11 +95,11 @@ $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 } # 99. Prompt profile loaded -New-SimulateTyping "PowerShell User Profile is loaded" +New-SimulateTyping "PowerShell User Profile is loaded" \ No newline at end of file