Add posh-git to Windows installations

This commit is contained in:
Manuel Thalmann 2023-07-27 02:22:09 +02:00
parent 7f7f126254
commit 94796dd5d9
4 changed files with 19 additions and 2 deletions

View file

@ -8,6 +8,7 @@ Write-Information "Allow addition of any number of profile files";
$context.AddPowerShellProfileStatement(
@(
'# Profile Files',
'$profilePath = "$PSScriptRoot/profile.d/*.ps1";',
'if (Test-Path $profilePath) {',
' . $profilePath;',

View file

@ -0,0 +1,7 @@
#!/bin/pwsh
param($context)
. "$PSScriptRoot/../../Scripts/Context.ps1";
[Context] $context = $context;
Write-Host "Configuring posh-git";
$context.AddPowerShellProfileStatement("posh-git", 'Import-Module "posh-git";');

View file

@ -57,11 +57,12 @@ function Invoke-WindowsInstallation([Context] $context)
exit;
}
if (-not $context.Get("AppAssociations")) {
if (-not $context.Get("MachineWideSoftware")) {
Write-Host "Setting up software with default app associations";
. "$softwarePath/WinSCP/Install.ps1" $context;
. "$softwarePath/Thunderbird/Install.ps1" $context;
$context.Set("AppAssociations", 1, "DWord");
. "$softwarePath/posh-git/Install.ps1" $context;
$context.Set("MachineWideSoftware", 1, "DWord");
}
New-PersonalUser $context;

View file

@ -0,0 +1,8 @@
#!/bin/pwsh
param($context);
. "$PSScriptRoot/../../Scripts/Context.ps1";
[Context] $context = $context;
Install-Module -Scope AllUsers posh-git;
powershell -c "Install-Module -Scope AllUsers posh-git;";
. "$PSScriptRoot/../../Config/posh-git/Install.ps1" $context;