From aa5d71eb4fd17789a6a90db9510802b028d94e78 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 29 Jun 2023 19:08:05 +0200 Subject: [PATCH] Add methods for getting or setting the current stage --- scripts/Windows/Scripts/Context.ps1 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/Windows/Scripts/Context.ps1 b/scripts/Windows/Scripts/Context.ps1 index 2422078c..4425d1b3 100644 --- a/scripts/Windows/Scripts/Context.ps1 +++ b/scripts/Windows/Scripts/Context.ps1 @@ -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"; }