Fix installation of chocolatey profile

This commit is contained in:
Manuel Thalmann 2023-07-19 16:19:25 +02:00
parent 67a90200df
commit a736000796

View file

@ -8,7 +8,14 @@ Push-Location ~;
$files = @((powershell -c '$PROFILE'), $PROFILE) | ForEach-Object { Resolve-Path -Relative $_ };
foreach ($profileFile in $files) {
Copy-Item -Force "~/$profileFile" "C:/Users/Default/$profileFile";
$fullName = "C:/Users/Default/$profileFile";
$dirName = Split-Path -Parent $fullName;
if (-not (Test-Path -PathType Container $dirName)) {
New-Item -Force -ItemType Directory $dirName;
}
Copy-Item -Force "~/$profileFile" $fullName;
}
Pop-Location;