Fix PowerShell
config installation
This commit is contained in:
parent
9918465b27
commit
a4535eaf05
|
@ -54,10 +54,20 @@ $null = New-Module {
|
||||||
}
|
}
|
||||||
|
|
||||||
Push-Location ~;
|
Push-Location ~;
|
||||||
$profiles = $profiles | ForEach-Object { [System.IO.Path]::GetRelativePath($(Get-Location), $_); };
|
$profiles = $profiles |
|
||||||
|
ForEach-Object { [System.IO.Path]::GetRelativePath($(Get-Location), $_); } |
|
||||||
|
ForEach-Object { "$HomeDir/$_" };
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($Category) {
|
||||||
|
if (-not $($Overwrite.IsPresent)) {
|
||||||
|
$Overwrite = $true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$profiles = $profiles | ForEach-Object { Join-Path (Split-Path -Parent $_) "conf.d" "$Category.ps1"; };
|
||||||
|
}
|
||||||
|
|
||||||
$profiles | ForEach-Object {
|
$profiles | ForEach-Object {
|
||||||
$fileName = "$HomeDir/$_";
|
|
||||||
$dirName = Split-Path -Parent $fileName;
|
$dirName = Split-Path -Parent $fileName;
|
||||||
|
|
||||||
if (-not (Test-Path -PathType Container $dirName)) {
|
if (-not (Test-Path -PathType Container $dirName)) {
|
||||||
|
@ -70,15 +80,6 @@ $null = New-Module {
|
||||||
Set-Content -Force "$fileName" "$Statement";
|
Set-Content -Force "$fileName" "$Statement";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
|
||||||
if ($Category) {
|
|
||||||
if (-not $($Overwrite.IsPresent)) {
|
|
||||||
$Overwrite = $true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$profiles = $profiles | ForEach-Object { Join-Path (Split-Path -Parent $_) "conf.d" "$Category.ps1"; };
|
|
||||||
}
|
|
||||||
|
|
||||||
Pop-Location;
|
Pop-Location;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue