I am not sure if this is an expected behavior:
Describe the Issue
It seems that the EndpointInitialization is not loading function from my module Core.AppBar.psm1
if the page is using -Content.
Startup.ps1
$EndpointInitialization = New-UDEndpointInitialization -Module @(
"$PSScriptRoot\Core\Core.AppBar.psm1",
)
$Pages = Get-ChildItem (Join-Path $PSScriptRoot 'Pages') -Recurse -File | ForEach-Object {
& $_.FullName
}
$Dashboard = New-UDDashboard -Title 'AdminCenter' -EndpointInitialization $EndpointInitialization -Pages $Pages
Core.AppBar.psm1
function New-AppBar
{
param
(
[string]$Title
)
$Drawer = New-UDDrawer -Children {
New-UDList -Children {
New-UDListItem -Label "Test" -Children {
New-UDListItem -Label "Temp" -OnClick { Invoke-UDRedirect -Url "/test/temp" }
}
}
}
New-UDAppbar -Children {
New-UDElement -Tag 'div' -Content {$title}
} -Drawer $Drawer
}
Page.psm1
New-UDPage -Url "/test/temp" -Icon home -Content {
New-AppBar -Titel 'Temp'
New-UDTextbox -Id 'txtTextfield' -Label 'First Name'
}
Error:
New-UDPage : The term 'New-AppBar' 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 C:\Users\augustin.ziegler\source\repos\Project\AdminPage\Pages\Test\TestTemp.ps1:1 char:1
+ New-UDPage -Url "/test/temp" -Icon home -Content {
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SyntaxError: (UniversalDashboard.Models.Page:Page) [New-UDPage], CommandNotFoundException
+ FullyQualifiedErrorId : UniversalDashboard.Cmdlets.NewPageCommand
```
It is working with an Endpoint typed page.
#### Version Information
- **Operating System**: Win10
- **PowerShell Version**: 5.1.17763.1007
- **Universal Dashboard Version**: 3.0.0-beta1
- **UD Hosting Method**: Powershell
#### Additional context
Add any other context about the problem here.