r/PowerShell • • Nov 06 '17

FoxDeploy: Creating Glorious PowerShell Dashboards

https://foxdeploy.com/2017/11/06/glorious-powershell-dashboards/
170 Upvotes

46 comments sorted by

View all comments

Show parent comments

1

u/tharagz08 Nov 27 '17

Dynamic pages are exactly what I was looking for. I think I'm running into the same problem you were originally though.

After inputting computer name I am being brought to a blank page. How do you call on the script you've stored in $Dynamic? From what I can tell your script is just starting up a new dashboard with the $HOMEPAGE variable, then redirecting that to the "/dynamic/$Computer" URL but none of the queries are being called on from within the $Dynamic variable.

1

u/saGot3n Nov 28 '17

Whooooops, replace that last part of the script with this, also remove the @colors from the script unless you have that setup.

Start-UDDashboard -Content { 
    New-UDDashboard -NavbarLinks $NavBarLinks -Title "Dashboard" -NavBarColor '#FF1c1c1c' -NavBarFontColor "#FF55b3ff" -BackgroundColor "#FF333333" -FontColor "#FFFFFFF" -Pages @(
        $HOMEPAGE,
        $dynamic
    ) 
}

1

u/tharagz08 Nov 28 '17

That got it goin! What a simple fix. I did end up getting it to work as well but I took a different approach. Instead of calling on two variables I used one and first built the page for user input, then once the input was received I built the second page and redirected to it. In the end probably the same results and same speed.

Have you experimented with multiple parameters yet? In my environment we deal with multiple domains where we do not have a trust setup. To work around this we store credentials in secure strings, encrypt them and then call on them as needed for each domain. Being able to pass multiple variables into these pages would make it possible to work around this limitation in my use case.

1

u/saGot3n Nov 28 '17

Awesome, glad you got it working! I havent had the need to do multiple variables, but I would assume its possible, or on your user input fields have one for each domain with a static domain variable so if a user uses domain1 for input the dynamic page would go to the dynamic page for domain1 and the same for domain2, it would go to the dynamic page you built for domain2.