Skip to content

Silent Documentation from previously exported config #123

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

Closed
martincaddick opened this issue Mar 15, 2023 · 5 comments
Closed

Silent Documentation from previously exported config #123

martincaddick opened this issue Mar 15, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@martincaddick
Copy link

Having previously exported my config using an AppId, TenantId and CertThumbprint (which is bloody awesome btw) I have all my config in json files in the correct folder structure.
I then want to silently document it using markdown as the output format.
I've done the BulkDocumentationType and saved the config to create a BulkDocument.json file

I can see this in the core.psm1 and can manually make it happen (again, awesome!)

    $settingObj = (ConvertFrom-Json (Get-Content -Path $global:SilentBatchFile -Raw -ErrorAction Stop))
    Invoke-ModuleFunction "Invoke-SilentBatchJob" $settingObj       

Is there another way I should be doing this?

@Micke-K
Copy link
Owner

Micke-K commented Mar 15, 2023

Hello!

Bulk documentation during a batch job should work. I haven't tried every possible option but I did a test a while back and it was working.

You say you exported your settings, are you doing an offline documentation? What documentation options do you use? What does the log file say?

Cheers!

@Micke-K Micke-K added the bug Something isn't working label Mar 20, 2023
@Micke-K
Copy link
Owner

Micke-K commented Mar 20, 2023

Hello,

I found the issue. I hope that this is the only one. For me, this had nothing to do with the batch job. I could do batch job documentation but it fails if I add Endpoint Security policies and have Reusable settings policies in the tenant. These are not supported for documentation anyway but caused the documentation to crash due to completely different policy type compared to the other Endpoint Security policies.

Can you try the attached file and see if it fixes the issue?

Thank you for the support!

Cheers!

Documentation.zip

@martincaddick
Copy link
Author

Still getting a bunch of these errors
image

This is the script I'm running and it generates a 4.5M markdown file (Took 27 minutes to export and document)

$startTime = Get-Date
# NonProd Tenant
$ApplicationId = 'xxxxx'
$CertificateThumbprint = 'xxxxxx'
$TenantId = 'xxxxxxx'
$fileLocation = "C:\github\Non-Production"
$markdownDocSettings = ($fileLocation + "\IntuneManagement\BulkDocumentationDestinationMarkdown.json") 

# Export the configuration
C:\github\IntuneManagement\Start-IntuneManagement.ps1 -Silent -TenantId $TenantId `
-SilentBatchFile ($fileLocation + "\IntuneManagement\BulkExport.json") `
-AppId $ApplicationId `
-Certificate $CertificateThumbprint `
-ShowConsoleWindow

# Document the settings into a single markdown document
$settingObj = (ConvertFrom-Json (Get-Content -Path $markdownDocSettings -Raw -ErrorAction Stop))
Invoke-ModuleFunction "Invoke-SilentBatchJob" $settingObj    

$endTime = Get-Date
Write-Host "Processing time is"($endTime-$startTime)

And the json files
BulkDocumentationDestinationMarkdown.json.txt
BulkExport.json.txt

@Micke-K
Copy link
Owner

Micke-K commented Apr 30, 2023

I'm going through the issues for the next release and found this ad realized I never replied to it. So sorry about that!

I do expect a lot of these warning. I get lots of them as well. To be honest , I don't even remember exactly what all of the means. Sometimes some settings will not have a description in the language files, sometimes these are generated when a parent property is not set etc. The documentation scripts for Template policies is quite complex so make sure it's all documented as expected. Raise another issue if not.

Is there anything else in this issue that you need answers for or can I close it?

Btw....what MD viewer do you use for that kind of large documents? When I created very large MD files, I could not even open them.

Cheers!

@martincaddick
Copy link
Author

I've been slack too ;-) Now in Europe for a few months but still progressing this stuff. My preferred markdown editor is Typora but it still struggles with the 4M file. I've reverted to using the html output which is clean at 7.5M.
Also, when I'm using markdown I really try hard to keep html out of the markdown. Means compromises on the data in tables and in some of them I still just have System.Collection type of responses.
Re: this issue. Lets close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants