diff --git a/scripts/Common/Config/powershell/lib.ps1 b/scripts/Common/Config/powershell/lib.ps1 index f395b4b7..40b23bb0 100644 --- a/scripts/Common/Config/powershell/lib.ps1 +++ b/scripts/Common/Config/powershell/lib.ps1 @@ -6,7 +6,7 @@ $null = New-Module { [string]$Category = $null, [Parameter(Position=0, Mandatory=$true)] [string]$Statement, - [switch]$Overwrite = $false + [switch]$Overwrite ) [System.Collections.Generic.List[string]] $shells = @(); @@ -29,6 +29,10 @@ $null = New-Module { $profiles = $profiles | ForEach-Object { [System.IO.Path]::GetRelativePath($(Get-Location), $_); }; if ($Category) { + if (-not $($Overwrite.IsPresent)) { + $Overwrite = $true; + } + $profiles = $profiles | ForEach-Object { Join-Path (Split-Path -Parent $_) "profile.d" "$Category.ps1"; }; }