Overwrite categorized profile files

This commit is contained in:
Manuel Thalmann 2024-03-20 22:56:04 +01:00
parent b91b80d1d3
commit d1611db116

View file

@ -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"; };
}