Clean files only if VALHALLA_ROOT
is present
This commit is contained in:
parent
c5762ca86f
commit
76d3dbb42f
|
@ -229,8 +229,11 @@ $null = New-Module {
|
||||||
Remove-LocalUser $user;
|
Remove-LocalUser $user;
|
||||||
Get-CimInstance Win32_UserProfile | Where-Object { $_.SID -eq $sid } | Remove-CimInstance;
|
Get-CimInstance Win32_UserProfile | Where-Object { $_.SID -eq $sid } | Remove-CimInstance;
|
||||||
Unregister-ScheduledTask -Confirm:$false $TaskName;
|
Unregister-ScheduledTask -Confirm:$false $TaskName;
|
||||||
Remove-Item -Recurse -Force "$ProjectRoot";
|
|
||||||
Remove-Item -Recurse -Force "$ArtifactRoot";
|
Remove-Item -Recurse -Force "$ArtifactRoot";
|
||||||
|
|
||||||
|
if ($ProjectRoot) {
|
||||||
|
Remove-Item -Recurse -Force "$ProjectRoot";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$trigger = New-ScheduledTaskTrigger -AtStartup;
|
$trigger = New-ScheduledTaskTrigger -AtStartup;
|
||||||
|
@ -240,7 +243,7 @@ $null = New-Module {
|
||||||
"-Command & { $script }",
|
"-Command & { $script }",
|
||||||
(ConvertTo-Injection $taskName),
|
(ConvertTo-Injection $taskName),
|
||||||
(ConvertTo-Injection $setupUser),
|
(ConvertTo-Injection $setupUser),
|
||||||
(ConvertTo-Injection $env:VALHALLA_ROOT),
|
(ConvertTo-Injection "$env:VALHALLA_ROOT"),
|
||||||
(ConvertTo-Injection (Get-ArtifactRoot))
|
(ConvertTo-Injection (Get-ArtifactRoot))
|
||||||
) -join " ");
|
) -join " ");
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ $null = New-Module {
|
||||||
#>
|
#>
|
||||||
function Get-StartupCommand {
|
function Get-StartupCommand {
|
||||||
($env:DEBUG ? "`$env:DEBUG = $([int]$env:DEBUG);" : "") +
|
($env:DEBUG ? "`$env:DEBUG = $([int]$env:DEBUG);" : "") +
|
||||||
"`$env:VALHALLA_ROOT = $(ConvertTo-Injection $env:VALHALLA_ROOT);" +
|
($env:VALHALLA_ROOT ? "`$env:VALHALLA_ROOT = $(ConvertTo-Injection $env:VALHALLA_ROOT);" : "") +
|
||||||
($env:PWSH_PATH ? "`$env:PWSH_PATH = $(ConvertTo-Injection $env:PWSH_PATH);" : "") +
|
($env:PWSH_PATH ? "`$env:PWSH_PATH = $(ConvertTo-Injection $env:PWSH_PATH);" : "") +
|
||||||
($env:BACKUP_ARCHIVE ? "`$env:BACKUP_ARCHIVE = $(ConvertTo-Injection ([System.IO.Path]::GetFullPath($env:BACKUP_ARCHIVE)));" : "") +
|
($env:BACKUP_ARCHIVE ? "`$env:BACKUP_ARCHIVE = $(ConvertTo-Injection ([System.IO.Path]::GetFullPath($env:BACKUP_ARCHIVE)));" : "") +
|
||||||
"`$env:INSTALLER_SCRIPT = $(ConvertTo-Injection (Resolve-Path $env:INSTALLER_SCRIPT));" +
|
"`$env:INSTALLER_SCRIPT = $(ConvertTo-Injection (Resolve-Path $env:INSTALLER_SCRIPT));" +
|
||||||
|
|
Loading…
Reference in a new issue