Variable issue after upgrade

I just tried to upgrade from v2.2.1 to v2.3.2.

For many of our multi-page dashboards, we have each page in a separate .ps1 file. Then there is a platform variable in PSU for the path to all our dashboard files.

So the code for an actual dashboard may look like:

$Pages = @()
$Pages += New-UDPage -Name 'Page1' -Content {
    . "$UDScriptRoot\PsuPage1.ps1"
}
#etc, until:
New-UDDashboard -Title 'Test' -Pages $Pages

The variable $UDScriptRoot would point to a path like “D:\repo\PSUCode”

This all worked fine in 2.2.1, but in 2.3.2 I get an error popup at the bottom of the screen (when attempting to load a sub- page). “The term ‘\PsuPage1.ps1’ is not recognized as the name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.”

It’s as though the variable didn’t exist or wasn’t instantiated in the environment. Removed and re-created the variable but that didn’t fix it.

Product: PowerShell Universal
Version: 2.2.1

I just found a workaround: I had the Environment for the dashboard set to “Default”. However, if it change it to anything else (7.1.4, Windows PowerShell 5.1, or Integrated), it works just fine. If I go to Settings → General, I see that no Default Environment is selected.

I would be interested to know why the “Default” environment works in the old version but not the new.

What do you have the default environment set to in Settings \ general?

It’s blank.

Ok. Then it’s using the integrated environment. I’ll take a peek at that to ensure that we don’t have a regression there with variables.

Just wanted to confirm that this behavior is still there in 2.4. Just upgraded and came across this issue. As soon as I changed the option on the dashboard from Default to Integrated all by Variables started working again.

I can’t reproduce this one. This is my configuration:

Empty environments.ps1 so it has the default environments defined.

My dashboard.ps1 looks like this.

New-PSUDashboard -Name "dashboard" -FilePath "dashboards\dashboard\dashboard.ps1" -BaseUrl "/dashboard" -Framework "UniversalDashboard:Latest" -Environment "Integrated" -SessionTimeout 0 -Credential "Default"

I have a single variable defined.

New-PSUVariable -Name "Test" -Value "asdfsaf"

My dashboard is very simple.

New-UDDashboard -Title "Hello, World!"  -Content {
    New-UDTypography $NotTest
    New-UDTypography $Test
    New-UDDynamic -Id 'element' -Content {
        New-UDTypography $Test
    }
}

image

I also tried using pages.

$Pages = @()
$Pages += New-UDPage -Name $Test -Content {

}

New-UDDashboard -Title "Hello, World!" -Pages $Pages

image

Notice anything I’m doing differently? I’m probably just missing something.

I will attempt to reproduce with steps as soon as I have some time. The Dashboard I had seen the behavior on suddenly turned from a POC to Production today without warning (Funny how that works). So I need to wait for the purchase of a full license to go through to setup a new Dev Environment.