2024-08-05 22:04:02 +00:00
|
|
|
using namespace Microsoft.Win32;
|
|
|
|
|
|
|
|
param(
|
|
|
|
$Action,
|
|
|
|
[hashtable] $Arguments
|
|
|
|
)
|
|
|
|
|
2024-08-07 19:05:32 +00:00
|
|
|
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
|
2024-08-05 22:04:02 +00:00
|
|
|
|
|
|
|
Start-SoftwareInstaller @PSBoundParameters `
|
|
|
|
-Installer {
|
|
|
|
param(
|
|
|
|
[scriptblock] $Installer
|
|
|
|
)
|
|
|
|
|
|
|
|
& $Installer -Action ([InstallerAction]::Configure)
|
|
|
|
} `
|
|
|
|
-Configurator {
|
|
|
|
$nativeProfile = powershell -c '$PROFILE';
|
2024-08-06 15:07:57 +00:00
|
|
|
$null = New-Item -Force $nativeProfile;
|
2024-08-05 22:04:02 +00:00
|
|
|
choco install -y --force chocolatey;
|
|
|
|
Copy-Item -Force $nativeProfile $PROFILE;
|
|
|
|
|
|
|
|
Push-Location ~;
|
|
|
|
$files = @($nativeProfile, $PROFILE) | ForEach-Object { Resolve-Path -Relative $_ };
|
|
|
|
Pop-Location;
|
|
|
|
|
|
|
|
foreach ($path in $files) {
|
|
|
|
$fullName = "$env:SystemDrive/Users/Default/$path";
|
|
|
|
$dirName = Split-Path -Parent $fullName;
|
|
|
|
|
|
|
|
if (-not (Test-Path -PathType Container $dirName)) {
|
|
|
|
$null = New-Item -Force -ItemType Directory $dirName;
|
|
|
|
}
|
|
|
|
|
|
|
|
Copy-Item -Force ~/"$path" $fullName;
|
|
|
|
}
|
|
|
|
|
|
|
|
Import-Module "$env:ChocolateyInstall/helpers/chocolateyProfile.psm1";
|
|
|
|
};
|