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 }