Reporting and Logging
Last updated
Last updated
A collection of cmdlets for creating, managing and exporting reports
- Find what resource is using a number on-prem - A function used by almost every function in UcmPsTools. Great logging utility
These cmdlets allow you to track the progress of actions in your scripts which you can then export to a variety of formats including HTML and CSV (more info)
Turn your post-script reports from this
into HTML like this
Or CSV's like this
Simply start by calling !
Each ReportItem is its own item for tracking and can have multiple ReportSteps, aka actions associated with it. For example, above, we create a new ReportItem for every user we are processing.
ReportSteps are typically items performed against a ReportItem so again using the report above, each step such as assigning a licence, applying a policy etc to a user (the ReportItem) and can be thought of as a column in the row.
Start off by calling , this creates a global variable to store the status of the report.
Then when you're ready, add a line to the report. Call . This creates a new PSObject to track the status against.
Once you have created a ReportItem, we can start logging steps against it using
Once you have finished working with that item, user, or whatever and are ready to move on to the next line, Call with the next item, or if you're ready to wrap things up, call to add the last step into the report object. Ready to be exported using either or (you can call both!)