File tree Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ public class MamlParameter : ICloneable
11
11
12
12
public string Type { get ; set ; }
13
13
14
+ public string FullType { get ; set ; }
15
+
14
16
public string Name { get ; set ; }
15
17
16
18
public bool Required { get ; set ; }
Original file line number Diff line number Diff line change @@ -2249,14 +2249,9 @@ function ConvertPsObjectsToMamlModel
2249
2249
$ParameterObject.Required = $Parameter.IsMandatory
2250
2250
$ParameterObject.PipelineInput = getPipelineValue $Parameter
2251
2251
$ParameterType = $Parameter.ParameterType
2252
- $ParameterObject.Type = if ($UseFullTypeName )
2253
- {
2254
- $ParameterType.FullName
2255
- }
2256
- else
2257
- {
2258
- getTypeString - typeObject $ParameterType
2259
- }
2252
+ $ParameterObject.Type = getTypeString - typeObject $ParameterType
2253
+ $ParameterObject.FullType = $ParameterType.FullName
2254
+
2260
2255
$ParameterObject.ValueRequired = -not ($Parameter.Type -eq " SwitchParameter" ) # thisDefinition is a heuristic
2261
2256
2262
2257
foreach ($Alias in $Parameter.Aliases )
@@ -2507,6 +2502,11 @@ function ConvertPsObjectsToMamlModel
2507
2502
$Parameter = Get-ParameterByName $ParameterName
2508
2503
if ($Parameter )
2509
2504
{
2505
+ if ($UseFullTypeName )
2506
+ {
2507
+ $Parameter = $Parameter.Clone ()
2508
+ $Parameter.Type = $Parameter.FullType
2509
+ }
2510
2510
$MamlCommandObject.Parameters.Add ($Parameter )
2511
2511
}
2512
2512
else
Original file line number Diff line number Diff line change @@ -406,7 +406,7 @@ Type: System.Management.Automation.SwitchParameter
406
406
407
407
'@
408
408
$expectedSyntax = normalizeEnds @'
409
- Get-Alpha [[ -WhatIf] <System.Management.Automation.SwitchParameter>] [[-CCC] <System. String>]
409
+ Get-Alpha [-WhatIf] [[-CCC] <String>]
410
410
411
411
'@
412
412
@@ -887,7 +887,7 @@ Type: System.String
887
887
888
888
'@
889
889
$expectedSyntax = normalizeEnds @'
890
- Get-MyCoolStuff [[-Foo] <System. String>] [[-Bar] <System. String>] [<CommonParameters>]
890
+ Get-MyCoolStuff [[-Foo] <String>] [[-Bar] <String>] [<CommonParameters>]
891
891
892
892
'@
893
893
$v3markdown | Where-Object {$_.StartsWith (' Type: ' )} | Out-String | Should Be $expectedParameters
You can’t perform that action at this time.
0 commit comments