From c29ffff455b9a0df02141be12235eab0bdfe4422 Mon Sep 17 00:00:00 2001 From: Leonard Jonathan Oh Date: Mon, 27 Nov 2023 22:00:41 +0000 Subject: [PATCH] Use string array for `-GamePlatform`, `-GameEngine`, and `-Game` to allow specifying multiple values --- Generate-GitBranches.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Generate-GitBranches.ps1 b/Generate-GitBranches.ps1 index d7263d3c..24ff8f25 100644 --- a/Generate-GitBranches.ps1 +++ b/Generate-GitBranches.ps1 @@ -31,13 +31,13 @@ param( [switch]$Push , # E.g. 'steam' - [string]$GamePlatform + [string[]]$GamePlatform , # E.g. 'hlds' or 'srcds' - [string]$GameEngine + [string[]]$GameEngine , # E.g. 'cstrike' - [string]$Game + [string[]]$Game ) Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' @@ -45,13 +45,13 @@ $ErrorActionPreference = 'Stop' # Get games $games = Get-Content $PSScriptRoot/games.json -Encoding utf8 -Force | ConvertFrom-Json -AsHashtable if ($GamePlatform) { - $games = $games | ? { $_['game_platform'] -eq $GamePlatform } + $games = $games | ? { $_['game_platform'] -in $GamePlatform } } if ($GameEngine) { - $games = $games | ? { $_['game_engine'] -eq $GameEngine } + $games = $games | ? { $_['game_engine'] -in $GameEngine } } if ($Game) { - $games = $games | ? { $_['game'] -eq $Game } + $games = $games | ? { $_['game'] -in $Game } } if ($games.Count -eq 0) { throw "No games found"