PortValhalla/scripts/Windows/Software/git/Manage.ps1

25 lines
721 B
PowerShell

#!/bin/pwsh
. "$PSScriptRoot/../../Scripts/Context.ps1";
$null = New-Module {
function Backup-Git([Context] $context) {}
function Restore-Git([Context] $context) {
Write-Host "Restoring git";
$script = New-TemporaryFile;
$script = Rename-Item $script "$($script.Name).sh" -PassThru;
Write-Information "Preparing setup script";
Set-Content $script (
[string]::Join(
"`n",
@(
"bash `"$PSScriptRoot/../../../Common/Config/git/install.sh`"",
"rm ~/.bashrc")));
Write-Information "Running prepared script";
Start-Process -Wait $script;
Remove-Item $script;
}
}