You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Should -HaveParameter alias123 -DefaultValue ... can't be used with aliases (AliasInfo). Will always say default-value is empty because.
Expected Behavior
Should be able to check a parameters default value when referencing command by alias.
Steps To Reproduce
functionTest-Parameter {
param (
[Parameter()]
[string]
$Name='test'
)
}
New-Alias t Test-ParameterGet-Command-Name t | Should -HaveParameter 'Name'-DefaultValue 'test'
Describe your environment
Pester version : 5.3.3 C:\Users\Frode\Documents\PowerShell\Modules\pester\5.3.3\Pester.psm1
PowerShell version : 7.3.1
OS version : Microsoft Windows NT 10.0.22621.0
Possible Solution?
Check if inputobject is of type AliasInfo and try to get the function/script using ResolvedCommand. If empty, write warning or fail, but at least we tried.
The text was updated successfully, but these errors were encountered:
Checklist
What is the issue?
Should -HaveParameter alias123 -DefaultValue ...
can't be used with aliases (AliasInfo
). Will always say default-value is empty because.Expected Behavior
Should be able to check a parameters default value when referencing command by alias.
Steps To Reproduce
Describe your environment
Pester version : 5.3.3 C:\Users\Frode\Documents\PowerShell\Modules\pester\5.3.3\Pester.psm1
PowerShell version : 7.3.1
OS version : Microsoft Windows NT 10.0.22621.0
Possible Solution?
Check if inputobject is of type
AliasInfo
and try to get the function/script usingResolvedCommand
. If empty, write warning or fail, but at least we tried.The text was updated successfully, but these errors were encountered: