Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assert-M365DSCBlueprint: export to json and switch to open browser after run #2345

Closed
yeti1305group opened this issue Sep 28, 2022 · 6 comments · Fixed by #2413 or #2421
Closed

Assert-M365DSCBlueprint: export to json and switch to open browser after run #2345

yeti1305group opened this issue Sep 28, 2022 · 6 comments · Fixed by #2413 or #2421
Assignees
Labels
Core Engine Enhancement New feature or request

Comments

@yeti1305group
Copy link

Description

I would like to use Microsoft 365 DSC in Azure Automation for reporting on deviations. Is it possible to incorporate 2 additional features:

  • option to export the result to json instead of html
  • have a switch to open browser with result. In Azure Automation I would like to switch of opening the file after running the command.

Proposed properties

  • option to export the result to json instead of html
  • have a switch to open browser with result. In Azure Automation I would like to switch of opening the file after running the command.

Special considerations or limitations

@andikrueger andikrueger added Enhancement New feature or request Core Engine labels Sep 28, 2022
@andikrueger
Copy link
Collaborator

The json switch sounds interesting.

Could you elaborate a bit more about the switch and the use case? AFAIK, Opening something from within Azure Automation is not possible.

@yeti1305group
Copy link
Author

The json switch sounds interesting.

Could you elaborate a bit more about the switch and the use case? AFAIK, Opening something from within Azure Automation is not possible.

Some additional information about our case.

JSON export:
We are trying to setup TSCM with M365DSC first before complete DSC. Working with JSON is easier when passing data between services and also easier to retrieve the relevant data. For the assert, but also for the compare it would be helpful to only export the relevant changes without all the HTML layout.

Opening HTML after Assert:
At this moment after the assert the HTML file is opened automatically. When running the assert in Azure Automation this gives an error (which of course can be suppressed). It would be nice when there is a switch like LaunchWebUI in the Export cmdlet.
afbeelding

This is a highlevel overview what we want to accomplish.
afbeelding

@andikrueger
Copy link
Collaborator

Thank you for the additional information. This helps to better understand your requirement.

I just reviewed the function and am very confident that we can add the switch easily.

  1. Move Assert-M365DSCConfiguration to M365DSCReporting.psm1
  2. Implement the common method to prep the configuration that is available within this module
  3. Modify the method to have a Switch for the opening of a file that defaults to open

Adding the json export is something I would need to review.

@yeti1305group
Copy link
Author

Thanks for your quick reply!
Would be great to have this switch and hopefully the json export is also something which is not to complicated. Now I'm looking into a (hopefully temporary) workaroud to strip the html in a runbook or Logic App.

@NikCharlebois NikCharlebois self-assigned this Oct 18, 2022
NikCharlebois added a commit to NikCharlebois/Microsoft365DSC that referenced this issue Oct 18, 2022
@NikCharlebois
Copy link
Collaborator

Changed the default behavior not to open the files by default. This is to align it with the New-M365DSCReportFromConfiguration cmdlet. Also added the -Type switch to Assert-M365DSCBlueprint and New-M365DSCDeltaReport to support specifying HTML or JSON

NikCharlebois added a commit that referenced this issue Oct 18, 2022
Fixes #2345 - Support for JSON report in Assert-M365DSCBlueprint
@yeti1305group
Copy link
Author

Thanks for the quick action. Works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Engine Enhancement New feature or request
Projects
None yet
3 participants