Closed agowa closed 3 years ago
JiraPS v1. and v2. use a method of injecting a new string into the TypeNames
of an PSCustomObject
.
This is done so that the default format for printing to the console can be manipulated.
It does not create any kind of type which you can use in the way you described about
$result.PSObject.TypeNames.Insert(0, 'JiraPS.Field')
This will be changed in JiraPS v3. Current state can be seen here: https://github.com/lipkau/JiraPS/tree/feature/ProperUserHandling
Description
Types cannot be accessed after the module is imported.
Steps To Reproduce
Import-Module -Name JiraPS
Get-JiraFilter -Id 1 | Get-Member
<= Look at TypeName. There is clearly a distinct type defined for objects in this module.[JiraPS.Filter]$myFilter = Get-JiraFilter -Id 1
<= But they cannot be accessed for type safe assignments.Expected behavior
The types being exported into the current session upon module import, so that they can be used in the usual way. E.g. For type safe assignments.
Your Environment
Possible Solution