From fd03df291240dde996cae59c6e8b08684dff7483 Mon Sep 17 00:00:00 2001 From: Rob Bos Date: Thu, 7 Sep 2023 11:22:02 +0200 Subject: [PATCH] Add missing module name --- Src/PowerShell/entrypoint.ps1 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Src/PowerShell/entrypoint.ps1 b/Src/PowerShell/entrypoint.ps1 index e6342e5..bf0aa25 100644 --- a/Src/PowerShell/entrypoint.ps1 +++ b/Src/PowerShell/entrypoint.ps1 @@ -76,20 +76,21 @@ function main { Add-Content -Value "actions='$jsonObject'" -Path $env:GITHUB_OUTPUT } -if (Get-Module -ListAvailable -Name "powershell-yaml") { - Write-Host "powershell-yaml Module exists" +$moduleName = "powershell-yaml" +if (Get-Module -ListAvailable -Name $moduleName) { + Write-Host "$moduleName Module exists" } else { - Write-Host "powershell-yaml Module does not exist" + Write-Host "$moduleName Module does not exist" Write-Host "Installing module for the yaml parsing" Install-Module -Name $moduleName -Force -Scope CurrentUser -AllowClobber } try { - Import-Module powershell-yaml -Force + Import-Module $moduleName -Force } catch { - Write-Error "Error importing the powershell-yaml module" + Write-Error "Error importing the $moduleName module" throw }