Force creation of profile files

This commit is contained in:
Manuel Thalmann 2023-07-27 02:28:37 +02:00
parent 5a4b5bf581
commit 00d349e162

View file

@ -46,7 +46,16 @@ class Context {
$profileFiles = $profileFiles | ForEach-Object { Join-Path (Split-Path -Parent $_) "profile.d" "$category.ps1"; };
}
$profileFiles | ForEach-Object { Add-Content "C:\Users\Default\$_" "`n$statement"; };
$profileFiles | ForEach-Object {
$dirName = Split-Path -Parent $_;
if (-not (Test-Path -PathType Container $dirName)) {
New-Item -ItemType Directory $dirName;
}
Add-Content -Force "C:\Users\Default\$_" "`n$statement";
};
Pop-Location;
}