Forum Discussion
Assistance with modifying existing (working) Powershell script to add totals for Users found
Not totally certain what you are looking for, but let's try this:
If you want to search for particular users you need to search inside the $EventFeed variable that is returned by this line:
$EventFeed = InvokeA2APIReq GET $EndPointAs I don't know what the output looks like I can't offer a lot of help here.
Do you want to modify the existing report to add user totals?
Do you want a combined reports for the 2 users, with username and counts?
It might be better to create a new script that calls your existing script, passing in the required params and then creating a report.
Amend the end of the existing script:
Write-Verbose "[INFO] query string: $EndPoint"
$EventFeed = InvokeA2APIReq GET $EndPoint
Write-Output $EventFeedto explicitly put the userData onto the pipeline.
The new script would be similar to:
$prodUsers = ./logDeploy.ps1 -User Prod
$devUsers = ./logDeploy.ps1 -User Dev (it will need to be in the same dir as the logDeploy script)
and the userData output from the logDeploy script can be parsed inside the new script to create a report.