Rename powershell command
This commit is contained in:
parent
8e4f0ccd9a
commit
9758a6428f
16 changed files with 35 additions and 35 deletions
|
@ -6,7 +6,7 @@ $null = New-Module {
|
|||
Write-Host "Starting Backup of Windows";
|
||||
$context = [Context]::new();
|
||||
$context.BackupName = $env:BACKUP_NAME ?? $(Read-Host -Prompt "Please enter a backup name");
|
||||
Invoke-WindowsBackup $context;
|
||||
Backup-WindowsInstallation $context;
|
||||
Write-Host "Never forget to store the backup somewhere safe!";
|
||||
Write-Host "I mean... what kind of a dumbass would ever forget to do so, right?";
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ function Invoke-WindowsInstallation([Context] $context)
|
|||
{
|
||||
Write-Host "Starting Installation and Restoration of Windows";
|
||||
. "$PSScriptRoot/../Scripts/Prerequisites.ps1";
|
||||
Invoke-Upgrade $context;
|
||||
Update-WindowsInstallation $context;
|
||||
New-PersonalUser $context;
|
||||
Invoke-WindowsRestore $context;
|
||||
Restore-WindowsInstallation $context;
|
||||
}
|
||||
|
|
|
@ -12,25 +12,25 @@
|
|||
. "$PSScriptRoot/../Software/TrackMania United Forever/Manage.ps1";
|
||||
. "$PSScriptRoot/../Software/VisualStudio/Manage.ps1";
|
||||
|
||||
function Invoke-WindowsBackup([Context] $context) {
|
||||
function Backup-WindowsInstallation([Context] $context) {
|
||||
Write-Information "Backing up Windows";
|
||||
$backupRoot = $context.BackupRoot();
|
||||
Invoke-FileBackup $context;
|
||||
Invoke-BackupGit $context;
|
||||
Invoke-BackupLGHub $context;
|
||||
Invoke-BackupManiaPlanet $context;
|
||||
Invoke-BackupOsu $context;
|
||||
Invoke-BackupOsuLazer $context;
|
||||
Invoke-BackupPuTTY $context;
|
||||
Invoke-BackupRetroArch $context;
|
||||
Invoke-BackupReWASD $context;
|
||||
Invoke-BackupTmNations $context;
|
||||
Invoke-BackupTmUnited $context;
|
||||
Invoke-BackupVisualStudio $context;
|
||||
Backup-PersonalFiles $context;
|
||||
Backup-Git $context;
|
||||
Backup-LogitechGHUB $context;
|
||||
Backup-ManiaPlanet $context;
|
||||
Backup-Osu $context;
|
||||
Backup-OsuLazer $context;
|
||||
Backup-PuTTY $context;
|
||||
Backup-RetroArch $context;
|
||||
Backup-reWASD $context;
|
||||
Backup-TmNations $context;
|
||||
Backup-TmUnited $context;
|
||||
Backup-VisualStudio $context;
|
||||
$context.Backup($backupRoot, "$backupRoot.7z", @("-sdel"));
|
||||
}
|
||||
|
||||
function Invoke-WindowsRestore([Context] $context) {
|
||||
function Restore-WindowsInstallation([Context] $context) {
|
||||
Write-Host "Restoring Windows";
|
||||
|
||||
function Read-Path()
|
||||
|
@ -59,8 +59,8 @@ function Invoke-WindowsRestore([Context] $context) {
|
|||
$context.Restore($backupPath, $context.BackupRoot());
|
||||
}
|
||||
|
||||
Invoke-FileRestore $context;
|
||||
Invoke-RestoreGit $context;
|
||||
Restore-PersonalFiles $context;
|
||||
Restore-Git $context;
|
||||
|
||||
Remove-Item -Recurse $context.RootDir;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
. "$PSScriptRoot/../Scripts/Context.ps1";
|
||||
|
||||
function Invoke-Upgrade([Context] $context)
|
||||
function Update-WindowsInstallation([Context] $context)
|
||||
{
|
||||
Write-Host "Upgrading Windows";
|
||||
Write-Host "Preparing for Windows Update";
|
||||
|
@ -19,7 +19,7 @@ function Invoke-Upgrade([Context] $context)
|
|||
elseif ((Get-WindowsUpdate -IgnoreReboot).Count -gt 0)
|
||||
{
|
||||
Write-Information "More updates are available. Restarting upgrade routine.";
|
||||
$null = Invoke-Upgrade $context;
|
||||
$null = Update-WindowsInstallation $context;
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -11,7 +11,7 @@ function Get-BackupCandidates() {
|
|||
return $candidates;
|
||||
}
|
||||
|
||||
function Invoke-FileBackup([Context] $context) {
|
||||
function Backup-PersonalFiles([Context] $context) {
|
||||
Write-Host "Backing up Personal Files";
|
||||
|
||||
foreach ($candidate in Get-BackupCandidates) {
|
||||
|
@ -19,7 +19,7 @@ function Invoke-FileBackup([Context] $context) {
|
|||
}
|
||||
}
|
||||
|
||||
function Invoke-FileRestore([Context] $context) {
|
||||
function Restore-PersonalFiles([Context] $context) {
|
||||
Write-Host "Restoring Personal Files";
|
||||
|
||||
foreach ($candidate in Get-BackupCandidates) {
|
||||
|
|
|
@ -4,7 +4,7 @@ $null = New-Module {
|
|||
$path = "$env:LOCALAPPDATA/LGHUB";
|
||||
$softwareName = "LGHub";
|
||||
|
||||
function Invoke-BackupLGHub([Context] $context) {
|
||||
function Backup-LogitechGHUB([Context] $context) {
|
||||
$hubName = "lghub.exe";
|
||||
$hubPath = $(Get-Process | Where-Object { [System.IO.Path]::GetFileName($_.Path) -eq $hubName })[0].Path;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ $null = New-Module {
|
|||
$path = "$HOME/Documents/ManiaPlanet";
|
||||
$softwareName = "ManiaPlanet";
|
||||
|
||||
function Invoke-BackupManiaPlanet([Context] $context) {
|
||||
function Backup-ManiaPlanet([Context] $context) {
|
||||
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ $null = New-Module {
|
|||
$softwareName = "PuTTY";
|
||||
$configFile = "$($softwareName).reg";
|
||||
|
||||
function Invoke-BackupPuTTY([Context] $context) {
|
||||
function Backup-PuTTY([Context] $context) {
|
||||
$tempDir = $context.GetTempDirectory();
|
||||
$fileName = Join-Path "$tempDir" $configFile;
|
||||
& reg export "HKCU\Software\SimonTatham" "$fileName" /y;
|
||||
|
|
|
@ -4,7 +4,7 @@ $null = New-Module {
|
|||
$path = "C:/tools/RetroArch-Win64";
|
||||
$softwareName = "RetroArch";
|
||||
|
||||
function Invoke-BackupRetroArch([Context] $context) {
|
||||
function Backup-RetroArch([Context] $context) {
|
||||
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ $null = New-Module {
|
|||
$path = "$HOME/Documents/TmForever";
|
||||
$softwareName = "TmNationsForever";
|
||||
|
||||
function Invoke-BackupTmNations([Context] $context) {
|
||||
function Backup-TmNations([Context] $context) {
|
||||
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ $null = New-Module {
|
|||
$path = "$HOME/Documents/TrackMania";
|
||||
$softwareName = "TmUnitedForever";
|
||||
|
||||
function Invoke-BackupTmUnited([Context] $context) {
|
||||
function Backup-TmUnited([Context] $context) {
|
||||
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ $null = New-Module {
|
|||
return Join-Path $($context.BackupRoot()) $packageName ".vsconfig";
|
||||
}
|
||||
|
||||
function Invoke-BackupVisualStudio([Context] $context) {
|
||||
function Backup-VisualStudio([Context] $context) {
|
||||
foreach ($version in $versions) {
|
||||
$configPath = Get-ConfigPath $context $version[0];
|
||||
$null = New-Item -Force -ItemType Directory "$(Split-Path -Parent $configPath)";
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
||||
|
||||
$null = New-Module {
|
||||
function Invoke-BackupGit([Context] $context) {}
|
||||
function Backup-Git([Context] $context) {}
|
||||
|
||||
function Invoke-RestoreGit([Context] $context) {
|
||||
function Restore-Git([Context] $context) {
|
||||
$script = New-TemporaryFile;
|
||||
$script = Rename-Item $script "$($script.Name).sh" -PassThru;
|
||||
Set-Content $script "bash `"$PSScriptRoot/../../../Common/Config/git/install.sh`"";
|
||||
|
|
|
@ -5,7 +5,7 @@ $null = New-Module {
|
|||
$softwareName = "osu!";
|
||||
$genericConfigName = "osu!.User.cfg";
|
||||
|
||||
function Invoke-BackupOsu([Context] $context) {
|
||||
function Backup-Osu([Context] $context) {
|
||||
$archive = $context.SoftwareArchive($softwareName);
|
||||
$context.Backup($path, $archive, @("-i@`"$PSScriptRoot/include.txt`""));
|
||||
& 7z rn "$archive" "osu!.$env:USERNAME.cfg" $genericConfigName;
|
||||
|
|
|
@ -4,7 +4,7 @@ $null = New-Module {
|
|||
$path = "$env:APPDATA/osu";
|
||||
$softwareName = "osu!lazer";
|
||||
|
||||
function Invoke-BackupOsuLazer([Context] $context) {
|
||||
function Backup-OsuLazer([Context] $context) {
|
||||
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`"", "-i!*.realm", "-i!*.db"));
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@ $null = New-Module {
|
|||
$path = "$env:PUBLIC/Documents/reWASD";
|
||||
$softwareName = "reWASD";
|
||||
|
||||
function Invoke-BackupReWASD([Context] $context) {
|
||||
function Backup-reWASD([Context] $context) {
|
||||
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-x@`"$PSScriptRoot/exclude.txt`""));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue