# Bugfix #48 https://github.com/IMJLA/Export-Permission/issues/48
# Sending a dummy object down the line to avoid errors
# TODO: More elegant solution needed. Downstream code should be able to handle null input.
# TODO: Why does this suppress errors, but the object never appears in the tables?
if ($null -eq $FilteredAccounts) {
$FilteredAccounts = [pscustomobject]@{
'Name' = 'NoAccountsMatchingCriteria'
'Group' = [pscustomobject]@{
'IdentityReference' = '.'
'Access' = '.'
'Name' = '.'
'Department' = '.'
'Title' = '.'
}
}
}
Expected Behavior
Code downstream of Get-FolderPermissionsBlock should be able to handle null input (if all accounts/objects have been filtered out by Get-FolderPermissionsBlock)
Current Behavior
Errors were being thrown (see https://github.com/IMJLA/Export-Permission/issues/48) so a dummy object was sent down the pipeline to avoid the errors. However that dummy object is unexpectedly disappearing and does not show up on the report. Besides, the dummy object is not an ideal solution anyway.
Possible Solution
Steps to Reproduce (for bugs)
Context
Your Environment
Module version used: 0.0.176
Operating System and PowerShell version: Win10 PS 7.4.0
Expected Behavior
Code downstream of Get-FolderPermissionsBlock should be able to handle null input (if all accounts/objects have been filtered out by Get-FolderPermissionsBlock)
Current Behavior
Errors were being thrown (see https://github.com/IMJLA/Export-Permission/issues/48) so a dummy object was sent down the pipeline to avoid the errors. However that dummy object is unexpectedly disappearing and does not show up on the report. Besides, the dummy object is not an ideal solution anyway.
Possible Solution
Steps to Reproduce (for bugs)
Context
Your Environment