Equivalent of -scripts parameter in universal?

I’m finally starting to work on converting my huge dashboard project into Universal 1.3.

Previously I could pass in some JavaScript files to New-UDDashboard with the -scripts parameter.

Do we have a way of doing the same in Universal now?

Also, how do I enabled auto reload, not seeing it in my settings.ps1 file.

Thanks,

I tried to add the scripts to:

C:\Program Files (x86)\Universal\UniversalDashboard\Frameworks\v3\index.html

but they don’t seem to load.

Any other ideas?

The scripts parameter has now been added and will now be available in tonight’s nightly build.

@adam

Downloaded the latest nightly zip a few moments ago, stopped the universal service, extracted zip into universal directory overwriting everything that was there. Started universal service again but my dashboard is complaining:

[07-23-20 10:23:51 AM] Startup: A parameter cannot be found that matches parameter name 'Scripts'.

If I import the module psm at the top of my script, it does load without error but my scripts aren’t accessible at /dashboardname/script.js

Do I need to do a published folder?

It’s probably because the nightly build doesn’t upgrade the UD Framework version. We only change that on release. You should stop PSU, delete the new framework in %ProgramData%\PowerShellUniversal and then start up PSU. It will redeploy the updated framework when it starts up since it isn’t there already.

You will need a published folder to host your script. It won’t discover the script.js automatically but if you put it in a published folder and then just include the relative path to the script in your -Scripts it will load it.

For example:

Published Folder

  • Path: C:\scripts
  • RequestPath: /scripts

Dashboard
-Scripts @(’/scripts/script.js’)

I’ve updated the docs to include some of this upgrade information.

Ok thanks for the info.

Before I was just putting my scripts in the client folder so published folder wasn’t necessary.

Will give it a try.

edit: yeah it is working - thanks

1 Like

@adam

Not sure the preferred way to report this but on the latest nightly sync-udelement seems to be broken.

You can open issues here: https://github.com/ironmansoftware/powershell-universal/issues