Succeeded
-| Command | Status |
-|---------|--------|
-$(($commandResults | ForEach-Object { "| ``$($_.CommandName)`` | $($_.Status) |`n" }) -join '')
+
+
+$(($successfulCommands | ForEach-Object { "- ``$($_.CommandName)`` `n" }) -join '')
+
+
+
+
"@
+ }
$summaryContent | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append
diff --git a/scripts/main.ps1 b/scripts/main.ps1
index 6557d1c..d9a1d87 100644
--- a/scripts/main.ps1
+++ b/scripts/main.ps1
@@ -3,18 +3,20 @@
Justification = 'Want to just write to the console, not the pipeline.'
)]
[CmdletBinding()]
-param()
+param(
+ [string]$Name = $env:DOCUMENT_PSMODULE_INPUT_Name,
+ [bool]$ShowSummaryOnSuccess = $env:DOCUMENT_PSMODULE_INPUT_ShowSummaryOnSuccess -eq 'true'
+)
$PSStyle.OutputRendering = 'Ansi'
'Microsoft.PowerShell.PlatyPS' | ForEach-Object {
- $name = $_
- Write-Output "Installing module: $name"
+ Write-Output "Installing module: $_"
$retryCount = 5
$retryDelay = 10
for ($i = 0; $i -lt $retryCount; $i++) {
try {
- Install-PSResource -Name $name -WarningAction SilentlyContinue -TrustRepository -Repository PSGallery
+ Install-PSResource -Name $_ -WarningAction SilentlyContinue -TrustRepository -Repository PSGallery
break
} catch {
Write-Warning "Installation of $($psResourceParams.Name) failed with error: $_"
@@ -25,7 +27,7 @@ $PSStyle.OutputRendering = 'Ansi'
Start-Sleep -Seconds $retryDelay
}
}
- Import-Module -Name $name
+ Import-Module -Name $_
}
$path = (Join-Path -Path $PSScriptRoot -ChildPath 'helpers') | Get-Item | Resolve-Path -Relative
@@ -37,18 +39,16 @@ Get-ChildItem -Path $path -Filter '*.ps1' -Recurse | Resolve-Path -Relative | Fo
Write-Host '::group::Loading inputs'
$env:GITHUB_REPOSITORY_NAME = $env:GITHUB_REPOSITORY -replace '.+/'
-$moduleName = [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Name) ? $env:GITHUB_REPOSITORY_NAME : $env:GITHUB_ACTION_INPUT_Name
-$showSummaryOnSuccess = $env:GITHUB_ACTION_INPUT_ShowSummaryOnSuccess -eq 'true'
$moduleSourceFolderPath = Resolve-Path -Path 'src' | Select-Object -ExpandProperty Path
$modulesOutputFolderPath = Join-Path -Path . -ChildPath 'outputs/module'
$docsOutputFolderPath = Join-Path -Path . -ChildPath 'outputs/docs'
$params = @{
- ModuleName = $moduleName
+ ModuleName = [string]::IsNullOrEmpty($Name) ? $env:GITHUB_REPOSITORY_NAME : $Name
ModuleSourceFolderPath = $moduleSourceFolderPath
ModulesOutputFolderPath = $modulesOutputFolderPath
DocsOutputFolderPath = $docsOutputFolderPath
- ShowSummaryOnSuccess = $showSummaryOnSuccess
+ ShowSummaryOnSuccess = $ShowSummaryOnSuccess
}
[pscustomobject]$params | Format-List | Out-String