PoshKeepass module within Universal Dashboard issue (works once)

Hi,

I’m just testing some implementation of PoshKeepass module and Universal Dashboard, and I am able to connect to my databases once the Universal Dashboard is started up. However, if I navigate to another page / or refresh the page the connection is no longer working.

Has anyone here tried using KeePass with Universal Dashboard ?
As a starter I am just trying to show the content, from my Keepass database, and the plan was to make a form to allow me to enter new credentials from, but if it does not work, I might have to look for a different password manager.

Starting dashboard, no error:
image
From the logfile after a refresh, navigation change:

It looks like it loses the keepassdatabaseconfiguration after navigation change.

Product: PowerShell Universal
Version: 1.5.16

Can you provide a snippet of how you are using the module? UD uses multiple runspaces and it can cause some weird stuff to happen with module state.

We provide the -PersistentRunspace setting to work around some of these state related issues. You could also try that: Dashboards - PowerShell Universal

$pages += New-UdPage -Name “KeepassTest” -Content {

    Import-Module PoshKeePass

    $KeepassEntry = Get-KeePassEntry -DatabaseProfileName "AutomationDB" -MasterKey $AutomationDBKey | select-Object CreationTime, Expires, UserName, Url, Notes, DatabaseProfileName, ParentGroup

    $KeepassGroup = Get-KeePassGroup -DatabaseProfileName "AutomationDB" -MasterKey $AutomationDBKey | Select-Object Name, FullPath, IconId

    New-UdGrid -Container -spacing 2 -Content {

        New-UdGrid -Item -LargeSize 12 -SmallSize 12 -Content {

            New-udTable -data $KeepassEntry -Title "KeepassEntry" -dense -showsearch

        }

        New-UdGrid -Item -largeSize 12 -smallSize 12 -content {

            New-udTable -data $KeepassGroup -Title "KeepassGroup" -dense

        }

    }

}

And the Keepass database configuration: get-keepassdatabaseconfiguration

DatabasePath : c:\temp\automationTest.kdbx
Default : True
Name : AutomationDB
UseMasterKey : True
KeyPath :
AuthenticationType : Master
UseNetworkAccount : False

Added the following to my “Settings.ps1” file:
Set-PSUSetting -APiEnvironment “PoshKeePass”

Also in “Environments.ps1”:
New-PSUEnvironment -Name “PoshKeePass” -Path “C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe” -Modules @(‘PoshKeePass’) -PersistentRunspace

Looks to have the same issue with these settings, is there any way you call these inside the dashboard/page, or should this be sufficient to make the above page persistent?

Works fine with Persistent workspace!