Refactor PowerShell profile script

This commit is contained in:
Manuel Thalmann 2024-08-07 21:34:40 +02:00
parent 2dfb9d58bf
commit a34aa6c143
10 changed files with 126 additions and 122 deletions
scripts/Common/Scripts

View file

@ -1,6 +1,6 @@
#!/bin/pwsh
. "$PSScriptRoot/../../Common/Scripts/Entrypoints.ps1";
. "$PSScriptRoot/../../Common/Software/PowerShell/profile.ps1";
. "$PSScriptRoot/../../Common/Software/PowerShell/Profile.ps1";
class Context {
[string]$EntryPoint;
@ -68,9 +68,9 @@ class Context {
[void] AddPowerShellProfileStatement([bool] $system, [string] $category, [string] $statement, [bool] $overwrite) {
if ($system) {
Add-PowerShellProfileStatement -System -Category $category -Statement $statement -Overwrite $overwrite;
Add-PowerShellProfileStatement -System -Category $category -Script $statement -Overwrite:$overwrite;
} else {
Add-PowerShellProfileStatement -Category $category -Statement $statement -Overwrite $overwrite;
Add-PowerShellProfileStatement -Category $category -Script $statement -Overwrite:$overwrite;
}
}