Latest PowerShell Universal.
I need to pass a property to an New-UDTableColumn to make a button in the -render but I want to hide that New-UDTableColumn from the users. Is that possible?
This is my code;
$Columns = @(
New-UDTableColumn -Title 'Namn' -Property 'Description' -IncludeInExport -IncludeInSearch -DefaultSortColumn
New-UDTableColumn -Title 'Behörighet?' -Property 'Access' -IncludeInExport -render {
New-CheckUsrGrpBox -CheckUserName $CheckUserName -ADGroup $EventData.name -OUUsr $OUUsr -OUGrp $OUGrp
}
New-UDTableColumn -Title '.' -Property 'Change' -render {
New-SmBtnADDRemoveUsrGrp -SyncUD "CheckUserGroup" -ADGroup $EventData.name -UserToADDRemove $CheckUserName -OUGrp $OUGrp -OUUsr $OUUsr -User $User -LocalIpAddress $LocalIpAddress -RemoteIpAddress $RemoteIpAddress
}
New-UDTableColumn -Title 'Gruppnamn' -Property 'Name'
)
$CheckGrpsData = Get-ADGroup -filter "samaccountname -like '$GrpToList'" -property * | ForEach-Object {
if ($null -ne $_) {
[PSCustomObject]@{
Name = $_.name
Description = $_.Description
}
}
}
if ($null -eq $CheckGrpsData) {
New-UDAlert -Severity 'error' -Text "Kunde inte utläsa någon data, Var vänlig försök igen senare!"
Break
}
else {
$SearchOption = New-UDTableTextOption -Search "Sök"
New-UDTable -Columns $Columns -Data $CheckGrpsData -DefaultSortDirection "Ascending" -Sort -TextOption $SearchOption -ShowSearch -ShowPagination -Dense -Export -ExportOption "xlsx, PDF" -PageSize 50
}
And it’s this line that I want to hide for the user in PSU:
New-UDTableColumn -Title 'Gruppnamn' -Property 'Name'
I’m out of idé how to hide it.
@Adam any idés how to hide it?