Skip to content

Commit

Permalink
feat: Import-ModuleMember ( Fixes #743 )
Browse files Browse the repository at this point in the history
  • Loading branch information
StartAutomating authored and StartAutomating committed Nov 28, 2023
1 parent 739ac0c commit b8243b1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Tests/Examples/Language.PowerShellXML.examples.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,29 @@
describe 'Language.PowerShellXML' {
it 'Language.PowerShellXML Example 1' {
$typesFile, $typeDefinition, $scriptMethod = Invoke-PipeScript {

types.ps1xml template '
<Types>
<!--{param([Alias("TypeDefinition")]$TypeDefinitions) $TypeDefinitions }-->
</Types>
'

typeDefinition.ps1xml template '
<Type>
<!--{param([Alias("PSTypeName")]$TypeName) "<Name>$($typename)</Name>" }-->
<!--{param([Alias("PSMembers","Member")]$Members) "<Members>$($members)</Members>" }-->
</Type>
'

scriptMethod.ps1xml template '
<ScriptMethod>
<!--{param([Alias("Name")]$MethodName) "<Name>$($MethodName)</Name>" }-->
<!--{param([ScriptBlock]$MethodDefinition) "<Script>$([Security.SecurityElement]::Escape("$MethodDefinition"))</Script>" }-->
</ScriptMethod>
'
}


$typesFile.Save("Test.types.ps1xml",
$typeDefinition.Evaluate(@{
TypeName='foobar'
Expand Down

0 comments on commit b8243b1

Please sign in to comment.