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 d8d6386fe3
commit aa5d71eb4f

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";
}