Hey! So the URL is entirely separate from the actual local file path.
I personally don’t use Get-UDPage, but I did have a look at the parameters and I don’t see anything that allows you to specify a path, only a name, so I think you might be restricted on that front.
I however don’t use Get-UDPage, instead I have some code in my main dashboard/app .ps1 which uses get-childitem recursively on a “$Rootpath/content” folder, and everything in there is organised into sub folders and it just loads the pages in from there (I also have a commented json string which is used to fill out the parameters of new-udpage in each file, so i can keep everything in one place). My urls/page names are all relative to the parent domain though.
This way, I can keep all my pages nicely organised either by team, or function or both, and regardless of where I put them, as long as they’re in rootpath\content, they’ll load into the app.
I then define my navigation menu manually, and keep that organized in separate sections.
$Pages = @()
$PageFiles = Get-ChildItem "$RootPath/content" -filter "*.ps1" -Recurse
Foreach ($PageFile in $PageFiles){
$PageMeta = Get-Content $PageFile -first 1
if($PageMeta -like "#META#`*"){
$PageSplat = $PageMeta.Substring(6) | ConvertFrom-Json | ConvertTo-HashTable
$Pages += New-UDPage @PageSplat -Content {
. $PageFile.FullName
}
}
}
Example page:
#META#{'title':'Page title','Name':'pagename', 'Role': ['role1','role2']}
New-UDHTML -Markup "Hello World"