Closed Bobberty closed 1 year ago
@Bobberty - Thank you for submitting this issue! I have reviewed and tested. It does not seem possible to fix the line 467 to allow -PassThrough
. As a workaround, you can instead change the parameter for the main script for parameter: -PassThru
Edit line 67: https://github.com/blakedrumm/SCOM-Scripts-and-SQL/blob/master/Powershell/General%20Functions/Get-UserRights.ps1#L67 replace the line with this:
[switch]$PassThru = $true
Describe the bug When changing line 467 to force passthru as a default, the system still writes the text output at the beginning of the script. Thus when treated as an object, the data turns into a small text string.
To Reproduce Steps to reproduce the behavior:
Expected behavior An object output that will allow easy Powershell processing.
Additional context This seems to be a flow problem. The params are assigned, header printed, default params assigned, process executed. Just guessing, but the process probably should be Params assigned, Default params assigned, header printed, process executed.