New-PUDProject - UD Scaffolding function

Hi all! Just wanted to share a function I built to speed up my own project create/testing. I find that I’m creating new dashboards all the time for testing out various features, and I needed a quicker way to spin these up.

I do feel like a module could be built for this (Similar to Ruby on Rails` ‘rails generate’) to allow for more customizing and more powerful scaffolding. This function is fairly simple and allows you to create single or multi-page projects with the below code. I went with New-PUDProject so I didn’t step on Adam’s naming scheme.

Function located in gist at https://gist.github.com/randalleverhart/b3dc66ba9fa122301668e77471cb02b2

$projectParams = @{
    'DashboardName' = 'Test Dashboard';
    'Pages' = 'Homepage', 'User Maintenance', 'Computer Maintenance';
    'FilePath' = '.\'
    'Port' = 8000
}

New-PUDProject @projectParams

-FilePath defaults to .\ and -Port defaults to 8080.

The code is sloppy but it works. If your -Pages names has spaces in them, it removes the spaces so it can create the variables correctly, but it keeps the spaces in the titles. Just thought I’d share!

Have a great day!

6 Likes