New-Udpage error

Good day everyone,

I am currently getting this error whenever I add a specific page to my dashboard. It’s working perfectly in the community version but not in the paid version.

Failed to get dashboard. Self referencing loop detected for property ‘module’ with type ‘System.Management.Automation.PSModuleInfo’. Path ‘pages[5].content[0].exportedFunctions.add-ADPermission’. Newtonsoft.Json.JsonSerializationException

Below is the script

New-UDPage -Name “Test” -Content {

Add-Type -AssemblyName ‘System.Web’
Get-PSSession | Remove-PSSession
$Credential = Import-Clixml C:\Dashboards\Reporting\Pwd\exchange.xml
$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://exchange01.test03.aginion.net/Powershell -Authentication Basic -Credential $Credential
Import-PSSession $session

$test=New-UDGrid -Title “Test” -Endpoint {

Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Where{$_.Lastlogontime -lt (Get-Date).AddDays(-30)} | Select DisplayName,UserPrincipalName,StorageLimitStatus,LastLogonTime | Out-UDGridData

}

New-UDLayout -Columns 1 -Content {
$test

}
}

Try to pipe Import-PSSession to Out-Null.

Import-PSSession $session | Out-Null

Hi Adam,

Thanks for the reply. That worked, the page is displaying now but for some reason the data is not being output to the grid. It just says “no results found” even though it does output data in powershell. I am using the same method for my AD reporting and that’s working fine.

Regards,

Leon