Prevent accessing an object multiple times at once

This commit is contained in:
Manuel Thalmann 2023-07-27 17:42:05 +02:00
parent 4f9c81f35f
commit e16dfd55d4

View file

@ -151,7 +151,9 @@ function Restore-PersonalApps([Context] $context) {
@($PROFILE, (powershell -c '$PROFILE')) | ForEach-Object {
Get-Item "$(Split-Path -Parent $_)/profile.d/*Oh My Posh*";
} | ForEach-Object {
Get-Content $_ | ForEach-Object {
$oldContent = Get-Content $_;
$oldContent | ForEach-Object {
$indicator = "oh-my-posh init";
$_ -replace $indicator,"$indicator --config ~/Nextcloud/.omp/manuel.omp.json";
} | Set-Content $_;