PSFunctionExplorer icon indicating copy to clipboard operation
PSFunctionExplorer copied to clipboard

Error while omite OutPutFormat parameter

Open LaurentLienhard opened this issue 5 years ago • 2 comments

When you use this without OutPutFormat parameter

Find-FUFunction -Path .\BuildOutput\PSItSupport\PSItSupport.psm1 | Write-FUGraph -ExportPath ".\Docs\MyGraph.png"

I have this error

Write-FUGraph : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:68
+ ... ort\PSItSupport.psm1 | Write-FUGraph -ExportPath ".\Docs\MyGraph.png"
+                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (FUFunction:FUFunction) [Write-FUGraph], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,Write-FUGraph

LaurentLienhard avatar Feb 15 '20 15:02 LaurentLienhard

I think it's related to ParameterSet If you comment on ParameterSetName in your function no more worry

[00:09.071] | PSItSupport> Find-FUFunction -Path .\BuildOutput\PSItSupport\PSItSupport.psm1 | Write-FUGraph -ExportPath ".\Docs\MyGraph.png"

[00:09.819] | PSItSupport> 

LaurentLienhard avatar Feb 15 '20 15:02 LaurentLienhard

or you put DefaultParameterSetName = "Graph" in your cmdletbinding

LaurentLienhard avatar Feb 15 '20 15:02 LaurentLienhard