Skip to content

Commit 383803a

Browse files
yishengjin1413vors
authored andcommitted
use tostring instead of FullName when get full type name (#309)
1 parent 862dffb commit 383803a

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/platyPS/platyPS.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2352,7 +2352,7 @@ function ConvertPsObjectsToMamlModel
23522352
$ParameterObject.PipelineInput = getPipelineValue $Parameter
23532353
$ParameterType = $Parameter.ParameterType
23542354
$ParameterObject.Type = getTypeString -typeObject $ParameterType
2355-
$ParameterObject.FullType = $ParameterType.FullName
2355+
$ParameterObject.FullType = $ParameterType.ToString()
23562356

23572357
$ParameterObject.ValueRequired = -not ($Parameter.Type -eq "SwitchParameter") # thisDefinition is a heuristic
23582358

test/Pester/PlatyPs.Tests.ps1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,18 +395,22 @@ Describe 'New-MarkdownHelp' {
395395
$WhatIf,
396396
[string]
397397
[Parameter(Position=2)]
398-
$CCC
398+
$CCC,
399+
[System.Nullable`1[System.Int32]]
400+
[Parameter(Position=3)]
401+
$ddd
399402
)
400403
}
401404

402405
It 'use full type name when specified' {
403406
$expectedParameters = normalizeEnds @'
404407
Type: System.String
408+
Type: System.Nullable`1[System.Int32]
405409
Type: System.Management.Automation.SwitchParameter
406410
407411
'@
408412
$expectedSyntax = normalizeEnds @'
409-
Get-Alpha [-WhatIf] [[-CCC] <String>]
413+
Get-Alpha [-WhatIf] [[-CCC] <String>] [[-ddd] <Int32>]
410414
411415
'@
412416

@@ -419,11 +423,12 @@ Get-Alpha [-WhatIf] [[-CCC] <String>]
419423
It 'not use full type name when specified' {
420424
$expectedParameters = normalizeEnds @'
421425
Type: String
426+
Type: Int32
422427
Type: SwitchParameter
423428
424429
'@
425430
$expectedSyntax = normalizeEnds @'
426-
Get-Alpha [-WhatIf] [[-CCC] <String>]
431+
Get-Alpha [-WhatIf] [[-CCC] <String>] [[-ddd] <Int32>]
427432
428433
'@
429434

0 commit comments

Comments
 (0)