PortValhalla/scripts/Windows/Config/chocolatey/Install.ps1

24 lines
656 B
PowerShell
Raw Normal View History

#!/bin/pwsh
powershell -c 'New-Item -Force $PROFILE';
2023-07-19 14:07:58 +00:00
choco install -y --force chocolatey;
Copy-Item -Force (powershell -c '$PROFILE') $PROFILE;
Push-Location ~;
$files = @((powershell -c '$PROFILE'), $PROFILE) | ForEach-Object { Resolve-Path -Relative $_ };
foreach ($profileFile in $files) {
2023-07-19 14:19:25 +00:00
$fullName = "C:/Users/Default/$profileFile";
$dirName = Split-Path -Parent $fullName;
if (-not (Test-Path -PathType Container $dirName)) {
2023-07-19 21:19:05 +00:00
$null = New-Item -Force -ItemType Directory $dirName;
2023-07-19 14:19:25 +00:00
}
Copy-Item -Force "~/$profileFile" $fullName;
}
Pop-Location;
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1";