2024-08-05 22:04:02 +00:00
|
|
|
using namespace Microsoft.Win32;
|
|
|
|
|
2024-08-07 19:05:32 +00:00
|
|
|
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
|
2024-10-13 13:35:24 +00:00
|
|
|
. "$PSScriptRoot/../../../Common/Software/powershell/Profile.ps1";
|
2024-08-05 22:04:02 +00:00
|
|
|
|
2024-10-13 23:55:19 +00:00
|
|
|
Start-SoftwareInstaller -Force @args `
|
2024-08-05 22:04:02 +00:00
|
|
|
-Configurator {
|
2024-09-23 00:10:42 +00:00
|
|
|
param([string] $Name)
|
2024-08-07 19:50:21 +00:00
|
|
|
[string] $backup = $null;
|
2024-08-05 22:04:02 +00:00
|
|
|
$nativeProfile = powershell -c '$PROFILE';
|
|
|
|
|
2024-08-07 19:50:21 +00:00
|
|
|
if (Test-Path -PathType Leaf $nativeProfile) {
|
|
|
|
$backup = "${nativeProfile}_";
|
|
|
|
Move-Item $nativeProfile $backup;
|
|
|
|
}
|
2024-08-05 22:04:02 +00:00
|
|
|
|
2024-08-07 19:50:21 +00:00
|
|
|
$null = New-Item -Force $nativeProfile;
|
|
|
|
choco install -y --force chocolatey;
|
2024-08-05 22:04:02 +00:00
|
|
|
|
2024-08-07 19:50:21 +00:00
|
|
|
Add-PowerShellProfileStatement `
|
2024-10-17 02:09:18 +00:00
|
|
|
-System `
|
2024-09-23 00:10:42 +00:00
|
|
|
-Category "$Name" `
|
2024-08-07 19:50:21 +00:00
|
|
|
-Script (Get-Content $nativeProfile | Out-String) `
|
|
|
|
-Append;
|
2024-08-05 22:04:02 +00:00
|
|
|
|
2024-08-07 19:50:21 +00:00
|
|
|
if ($backup) {
|
|
|
|
Move-Item $backup $nativeProfile;
|
2024-08-05 22:04:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Import-Module "$env:ChocolateyInstall/helpers/chocolateyProfile.psm1";
|
|
|
|
};
|