From b888b7ee4e3c21c9ba353e9ef2b555ca38aa1534 Mon Sep 17 00:00:00 2001 From: StevePJP <34476409+StevePJp@users.noreply.github.com> Date: Mon, 1 Jun 2020 16:11:01 +0900 Subject: [PATCH] Fix for command types on pwsh --- templates/PSFTests/general/Help.Tests.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/PSFTests/general/Help.Tests.ps1 b/templates/PSFTests/general/Help.Tests.ps1 index f34879a..be1c012 100644 --- a/templates/PSFTests/general/Help.Tests.ps1 +++ b/templates/PSFTests/general/Help.Tests.ps1 @@ -48,7 +48,9 @@ if ($SkipTest) { return } . $ExceptionsFile $includedNames = (Get-ChildItem $CommandPath -Recurse -File | Where-Object Name -like "*.ps1").BaseName -$commands = Get-Command -Module (Get-Module $ModuleName) -CommandType Cmdlet, Function, Workflow | Where-Object Name -in $includedNames +$commandTypes = @('Cmdlet', 'Function') +if ($PSVersionTable.PSEdition -eq 'Desktop' ) { $commandTypes += 'Workflow' } +$commands = Get-Command -Module (Get-Module $ModuleName) -CommandType $commandTypes | Where-Object Name -In $includedNames ## When testing help, remember that help is cached at the beginning of each session. ## To test, restart session.