New-HierarchicalTreeNode not recognized in latest modules
SumeshP opened this issue · 1 comments
SumeshP commented
New-HierarchicalTreeNode
New-HierarchicalTreeNode : The term 'New-HierarchicalTreeNode' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At line:1 char:1
- New-HierarchicalTreeNode
-
+ CategoryInfo : ObjectNotFound: (New-HierarchicalTreeNode:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
Manually adding the function to session works, but looks like the module import fails somewhere.
PrzemyslawKlys commented
Fixed. the issue was because function name was New-HierarchicalTreeNode and alias for it was the same. Republished, and updated sources as well. Should work now.
#Import-Module .\PSWriteHTML.psd1 -Force
$ProcessSmaller = Get-Process | Select-Object -First 1
New-HTML -Name 'Test' -FilePath "$PSScriptRoot\Example29-HierarchicalTree01.html" -Show {
New-HTMLSection {
New-HTMLSection -HeaderText 'Test 1' {
New-HTMLTable -DataTable $ProcessSmaller
}
New-HTMLSection -HeaderText 'Test 2' {
New-HTMLHierarchicalTree {
New-HierarchicalTreeNode -Label 'Test' -Description 'Long test'
New-HierarchicalTreeNode -Label 'Test 2nd' -To 'Test' -Description 'You need1'
New-HierarchicalTreeNode -Label 'Test 3rd' -To 'Test' -Description 'You ooo'
New-HierarchicalTreeNode -Label 'Test 4th' -To 'Test 2nd' -Description 'You ooo'
}
}
}
} -Online