Add methods for getting or setting the current stage

This commit is contained in:
Manuel Thalmann 2023-06-29 19:08:05 +02:00
parent a8cdefd3d3
commit bf6700ae2f

View file

@ -6,6 +6,7 @@ class Context {
[string]$AdminName = "Admin";
[string]$ConfigRoot = "HKLM:\Software\PortValhalla";
[string]$RunOnceName = "PortValhalla";
[string]$StagePropertyName = "Stage";
[string] ProjectRoot() {
return Resolve-Path (Join-Path $PSScriptRoot ".." ".." "..");
@ -44,6 +45,14 @@ class Context {
}
}
[void] SetStage([string] $name) {
$this.Set($this.StagePropertyName, $name, "ExpandString");
}
[string] GetStage() {
return $this.Get($this.StagePropertyName);
}
[string] ArchivePath($name) {
return Join-Path $this.BackupRoot() "$name.7z";
}