Functions/Invoke-IntuneDocumentation.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
Function Invoke-IntuneDocumentation(){
    <#
    .DESCRIPTION
    This Script documents an Intune Tenant with almost all settings, which are available over the Graph API.
    NOTE: This no longer does Conditional Access
    The Script is using the PSWord and Microsoft.Graph.Intune Module. Therefore you have to install them first.
 
    .EXAMPLE
    Invoke-IntuneDocumentation -FullDocumentationPath c:\temp\IntuneDoc.docx
 
    .NOTES
    Author: Thomas Kurth/baseVISION
    Co-Author: jflieben
    Co-Author: Robin Dadswell
    Date: 28.07.2019
 
    History
        See Release Notes in Github.
 
    ExitCodes:
        99001: Could not Write to LogFile
        99002: Could not Write to Windows Log
        99003: Could not Set ExitMessageRegistry
    #>

    [CmdletBinding()]
    Param(
        [ValidateScript({
            if($_ -notmatch "(\.docx)"){
                throw "The file specified in the path argument must be of type docx"
            }
            return $true 
        })]
        [System.IO.FileInfo]$FullDocumentationPath = ".\IntuneDocumentation.docx"
    )
    ## Manual Variable Definition
    ########################################################
    $DebugPreference = "Continue"
    $ScriptName = "DocumentIntune"
    $MaxStringLengthSettings = 350

    #region Initialization
    ########################################################
    Write-Log "Start Script $Scriptname"
    #region Authentication
    Connect-MSGraph
    #endregion
    #region Main Script
    ########################################################
    #region Save Path

    #endregion
    #region CopyTemplate
    if((Test-Path -Path $FullDocumentationPath)){
        Write-Log "File already exists, does not use built-in template." -Type Warn
    } else {
        Copy-Item "$PSScriptRoot\..\Data\Template.docx" -Destination $FullDocumentationPath
        Update-WordText -FilePath $FullDocumentationPath -ReplacingText "DATE" -NewText (Get-Date -Format "HH:mm dd.MM.yyyy")
        try{
            $org = Invoke-MSGraphRequest -Url /organization
            Update-WordText -FilePath $FullDocumentationPath -ReplacingText "TENANT" -NewText $org.value.displayName
        } catch{
            Update-WordText -FilePath $FullDocumentationPath -ReplacingText "TENANT" -NewText ""
        }
        
    }
    #endregion
    #region Document Apps
    $Intune_Apps = @()
    Get-IntuneMobileApp | ForEach-Object {
        try{
            $App_Assignment = Get-IntuneMobileAppAssignment -mobileAppId $_.id
            if($App_Assignment){
                $Intune_App = New-Object -TypeName PSObject
                $Intune_App | Add-Member Noteproperty "Publisher" $_.publisher
                $Intune_App | Add-Member Noteproperty "DisplayName" $_.displayName
                $Intune_App | Add-Member Noteproperty "Type" (Format-MsGraphData $_.'@odata.type')
                $Assignments = @()
                foreach($Assignment in $App_Assignment) {
                    if($null -ne $Assignment.target.groupId){
                        $Assignments += "$((Get-AADGroup -groupid $Assignment.target.groupId).displayName)`n - Intent:$($Assignment.intent)"
                    } else {
                        $Assignments += "$(($Assignment.target.'@odata.type' -replace "#microsoft.graph.",''))`n - Intent:$($Assignment.intent)"
                    }
                }
                $Intune_App | Add-Member Noteproperty "Assignments" ($Assignments -join "`n")
                $Intune_Apps += $Intune_App
            } else {
                $Intune_App = New-Object -TypeName PSObject
                $Intune_App | Add-Member Noteproperty "Publisher" $_.publisher
                $Intune_App | Add-Member Noteproperty "DisplayName" $_.displayName
                $Intune_App | Add-Member Noteproperty "Type" (Format-MsGraphData $_.'@odata.type')
                $Intune_App | Add-Member Noteproperty "Assignments" "Not assigned"
                $Intune_Apps += $Intune_App
            }
        } catch {
            $Intune_App = New-Object -TypeName PSObject
            $Intune_App | Add-Member Noteproperty "Publisher" $_.publisher
            $Intune_App | Add-Member Noteproperty "DisplayName" $_.displayName
            $Intune_App | Add-Member Noteproperty "Type" (Format-MsGraphData $_.'@odata.type')
            $Intune_App | Add-Member Noteproperty "Assignments" "Error getting Assignemnts"
            $Intune_Apps += $Intune_App
        }
    } 
    Add-WordText -FilePath $FullDocumentationPath -Heading Heading1 -Text "Applications"
    $Intune_Apps | Sort-Object Publisher,DisplayName | Add-WordTable -FilePath $FullDocumentationPath -AutoFitStyle Contents -Design LightListAccent2
    #endregion
    #region Document App protection policies
    Add-WordText -FilePath $FullDocumentationPath -Heading Heading1 -Text "App Protection Policies"
    $MAMs = Get-IntuneAppProtectionPolicy
    foreach($MAM in $MAMs){
        write-Log "App Protection Policy: $($MAM.displayName)"
        Add-WordText -FilePath $FullDocumentationPath -Heading Heading2 -Text $MAM.displayName
        $ht2 = @{}
        $MAM.psobject.properties | ForEach-Object { $ht2[(Format-MsGraphData $($_.Name))] = (Format-MsGraphData $($_.Value)) }
        ($ht2.GetEnumerator() | Sort-Object -Property Name | Select-Object Name,Value) | Add-WordTable -FilePath $FullDocumentationPath -AutoFitStyle Window -Design LightListAccent2 
        $id = $MAM.id
        $MAMA = Get-DeviceAppManagement_AndroidManagedAppProtections_Assignments -androidManagedAppProtectionId $id -androidManagedAppProtectionODataType microsoft.graph.androidManagedAppProtection
        $MAMA = Get-DeviceAppManagement_IosManagedAppProtections_Assignments -iosManagedAppProtectionId $id -iosManagedAppProtectionODataType microsoft.graph.iosManagedAppProtection
        if($MAMA){
            write-Log "Getting MAM Policy assignment..."
            Add-WordText -FilePath $FullDocumentationPath -Heading Heading3 -Text "Assignments"
            if($APPA.count -gt 1){
                $Assignments = @()
                foreach($group in $MAMA){
                    $Assignments += (Get-AADGroup -groupid $group.target.groupId).displayName
                }
                $Assignments | Add-WordText -FilePath $FullDocumentationPath -Size 12
            } else {
                (Get-AADGroup -groupid $MAMA.target.groupId).displayName | Add-WordText -FilePath $FullDocumentationPath -Size 12
            }
        }
    }
    #endregion
    #region Document App configuration policies
    Add-WordText -FilePath $FullDocumentationPath -Heading Heading1 -Text "App Configuration Policies"
    $MACs = Get-DeviceAppManagement_MobileAppConfigurations
    foreach($MAC in $MACs){
        write-Log "App Protection Policy: $($MAC.displayName)"
        Add-WordText -FilePath $FullDocumentationPath -Heading Heading2 -Text $MAC.displayName
        $ht2 = @{}
        $MAC.encodedSettingXml = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($MAC.encodedSettingXml))
        $MAC.psobject.properties | ForEach-Object { $ht2[(Format-MsGraphData $($_.Name))] = (Format-MsGraphData $($_.Value)) }
        ($ht2.GetEnumerator() | Sort-Object -Property Name | Select-Object Name,Value) | Add-WordTable -FilePath $FullDocumentationPath -AutoFitStyle Window -Design LightListAccent2 
        $id = $MAM.id
        
        $MAMA = Get-DeviceAppManagement_MobileAppConfigurations_Assignments -managedDeviceMobileAppConfigurationId $id
        if($MAMA){
            write-Log "Getting Mobile Application Configuration assignment..."
            Add-WordText -FilePath $FullDocumentationPath -Heading Heading3 -Text "Assignments"
            if($APPA.count -gt 1){
                $Assignments = @()
                foreach($group in $MAMA){
                    $Assignments += (Get-AADGroup -groupid $group.target.groupId).displayName
                }
                $Assignments | Add-WordText -FilePath $FullDocumentationPath -Size 12
            } else {
                (Get-AADGroup -groupid $MAMA.target.groupId).displayName | Add-WordText -FilePath $FullDocumentationPath -Size 12
            }
        }
    }
    #endregion
    #region Document Compliance Policies
    Add-WordText -FilePath $FullDocumentationPath -Heading Heading1 -Text "Compliance Policies"
    $DCPs = Get-IntuneDeviceCompliancePolicy
    foreach($DCP in $DCPs){
        write-Log "Device Compliance Policy: $($DCP.displayName)"
        Add-WordText -FilePath $FullDocumentationPath -Heading Heading2 -Text $DCP.displayName
        $ht2 = @{}
        $DCP.psobject.properties | ForEach-Object { $ht2[(Format-MsGraphData $($_.Name))] = (Format-MsGraphData $($_.Value)) }
        ($ht2.GetEnumerator() | Sort-Object -Property Name | Select-Object Name,Value) | Add-WordTable -FilePath $FullDocumentationPath -AutoFitStyle Window -Design LightListAccent2 
        $id = $DCP.id
        $DCPA = Get-IntuneDeviceCompliancePolicyAssignment -deviceCompliancePolicyId $id
        if($DCPA){
            write-Log "Getting Compliance Policy assignment..."
            Add-WordText -FilePath $FullDocumentationPath -Heading Heading3 -Text "Assignments"
            if($DCPA.count -gt 1){
                $Assignments = @()
                foreach($group in $DCPA){
                    $Assignments += (Get-AADGroup -groupid $group.target.groupId).displayName
                }
                $Assignments | Add-WordText -FilePath $FullDocumentationPath -Size 12
            } else {
                (Get-AADGroup -groupid $DCPA.target.groupId).displayName | Add-WordText -FilePath $FullDocumentationPath -Size 12
            }
        }
    }
    #endregion
    #region Document T&C
    write-Log "Terms and Conditions"
    $GAndT = Get-IntuneTermsAndConditions
    if($GAndT){
        Add-WordText -FilePath $FullDocumentationPath -Heading Heading1 -Text "Terms and Conditions"
        $GAndT | ForEach-Object { $_ | Select-Object -Property id,createdDateTime,lastModifiedDateTime,displayName,title,version } | Add-WordTable -FilePath $FullDocumentationPath -AutoFitStyle Contents -Design LightListAccent2
    }
    #endregion
    #region Document EnrollmentRestrictions
    Add-WordText -FilePath $FullDocumentationPath -Heading Heading1 -Text "Device Enrollment Restrictions"
    $Restrictions = Get-IntuneDeviceEnrollmentConfiguration
    foreach($restriction in $Restrictions){
        $ht2 = @{}
        $restriction.psobject.properties | ForEach-Object { if($_.Name -ne "@odata.type"){$ht2[(Format-MsGraphData $($_.Name))] = ((Format-MsGraphData "$($_.Value) "))} }
        ($ht2.GetEnumerator() | Sort-Object -Property Name | Select-Object Name,Value) | Add-WordTable -FilePath $FullDocumentationPath -AutoFitStyle Window -Design LightListAccent2
    }
    #endregion
    #region Document Device Configurations
    Add-WordText -FilePath $FullDocumentationPath -Heading Heading1 -Text "Device Configuration"
    $DCPs = Get-IntuneDeviceConfigurationPolicy
    foreach($DCP in $DCPs){
        write-Log "Device Compliance Policy: $($DCP.displayName)"
        Add-WordText -FilePath $FullDocumentationPath -Heading Heading2 -Text $DCP.displayName
        $ht2 = @{}
        $DCP.psobject.properties | ForEach-Object { 
            $ht2[(Format-MsGraphData $($_.Name))] = if((Format-MsGraphData "$($_.Value)").Length -gt $MaxStringLengthSettings){
                    "$((Format-MsGraphData "$($_.Value)").substring(0, $MaxStringLengthSettings))..."
                } else {
                    "$((Format-MsGraphData "$($_.Value)")) "
                }
        }
        ($ht2.GetEnumerator() | Sort-Object -Property Name | Select-Object Name,Value) | Add-WordTable -FilePath $FullDocumentationPath -AutoFitStyle Window -Design LightListAccent2
        $id = $DCP.id
        $DCPA = Get-IntuneDeviceConfigurationPolicyAssignment -deviceConfigurationId $id
        if($DCPA){
            write-Log "Getting Compliance Policy assignment..."
            Add-WordText -FilePath $FullDocumentationPath -Heading Heading3 -Text "Assignments"
            if($DCPA.count -gt 1){
                $Assignments = @()
                foreach($group in $DCPA){
                    if($null -ne $group.target.groupId){
                        $Assignments += (Get-AADGroup -groupid $group.target.groupId).displayName
                    } else {
                        $Assignments += "$(($group.target.'@odata.type' -replace "#microsoft.graph.",''))"
                    }
                    
                }
                $Assignments | Add-WordText -FilePath $FullDocumentationPath -Size 12
            } else {
                if($null -ne $DCPA.target.groupId){
                    (Get-AADGroup -groupid $DCPA.target.groupId).displayName | Add-WordText -FilePath $FullDocumentationPath  -Size 12
                } else {
                    "$(($DCPA.target.'@odata.type' -replace "#microsoft.graph.",''))" | Add-WordText -FilePath $FullDocumentationPath  -Size 12
                }
                
            }
        }
    }
    $ADMXPolicies = Get-ADMXBasedConfigurationProfile
    foreach($ADMXPolicy in $ADMXPolicies){
        write-Log "Device Configuration (ADMX): $($ADMXPolicy.DisplayName)"
        Add-WordText -FilePath $FullDocumentationPath -Heading Heading2 -Text $ADMXPolicy.DisplayName
        $ADMXPolicy.Settings | Add-WordTable -FilePath $FullDocumentationPath -AutoFitStyle Window -Design LightListAccent2
    }
    #endregion
    #region Device Management Scripts (PowerShell)
    Add-WordText -FilePath $FullDocumentationPath -Heading Heading1 -Text "Device Management Scripts"
    $PSScripts = Get-DeviceManagementScript
    foreach($PSScript in $PSScripts){
        Add-WordText -FilePath $FullDocumentationPath -Heading Heading2 -Text $PSScript.displayName
        $ht2 = @{}
        $PSScript.psobject.properties | ForEach-Object { 
            if($_.Name -ne "scriptContent"){
                $ht2[(Format-MsGraphData $($_.Name))] = "$($_.Value)"
            }
        }
        ($ht2.GetEnumerator() | Sort-Object -Property Name | Select-Object Name,Value) | Add-WordTable -FilePath $FullDocumentationPath -AutoFitStyle Window -Design LightListAccent2
        
        Add-WordText -FilePath $FullDocumentationPath -Heading Heading3 -Text "Script"
        $PSScript.scriptContent | Add-WordText -FilePath $FullDocumentationPath -Size 10 -Italic -FontFamily "Courier New"
    }
    #endregion
    #region AutoPilot Configuration
    Add-WordText -FilePath $FullDocumentationPath -Heading Heading1 -Text "AutoPilot Configuration"
    $AutoPilotConfigs = Get-WindowsAutopilotConfig
    foreach($APC in $AutoPilotConfigs){
        write-Log "AutoPilot Config: $($APC.displayName)"
        Add-WordText -FilePath $FullDocumentationPath -Heading Heading2 -Text $APC.displayName
        $ht2 = @{}
        $APC.psobject.properties | ForEach-Object { 
            $ht2[(Format-MsGraphData $($_.Name))] = if((Format-MsGraphData "$($_.Value)").Length -gt $MaxStringLengthSettings){
                    "$((Format-MsGraphData "$($_.Value)").substring(0, $MaxStringLengthSettings))..."
                } else {
                    "$((Format-MsGraphData "$($_.Value)")) "
                }
        }
        ($ht2.GetEnumerator() | Sort-Object -Property Name | Select-Object Name,Value) | Add-WordTable -FilePath $FullDocumentationPath -AutoFitStyle Window -Design LightListAccent2
    }
    #endregion

    #region Enrollment Status Page Configuration
    Add-WordText -FilePath $FullDocumentationPath -Heading Heading1 -Text "Enrollment Status Pages"
    $EnrollmentStatusPage = Get-EnrollmentStatusPage

    foreach($ESP in $EnrollmentStatusPage){
        write-Log "Enrollment Status Page Config: $($ESP.displayName)"
        $ESPtype = $ESP.type
        switch($ESPtype){
            "win10EnrollmentCompletionPageConfiguration" { $ESPtype = "ESP" }
            "deviceEnrollmentLimitConfiguration" { $ESPtype = "Enrollment Limit" }
            "deviceEnrollmentPlatformRestrictionsConfiguration" { $ESPtype = "Platform Restrictions" }
            "deviceEnrollmentwinHelloForBusinessConfiguration" { $ESPtype = "Windows Hello for Business" }
        }
        Add-WordText -FilePath $FullDocumentationPath -Heading Heading2 -Text "$($ESPtype) - $($ESP.displayName)"
        
        $ht2 = @{}
        $ESP.psobject.properties | ForEach-Object { 
            $ht2[(Format-MsGraphData $($_.Name))] = if((Format-MsGraphData "$($_.Value)").Length -gt $MaxStringLengthSettings){
                    "$((Format-MsGraphData "$($_.Value)").substring(0, $MaxStringLengthSettings))..."
                } else {
                    "$((Format-MsGraphData "$($_.Value)")) "
                }
        }
        ($ht2.GetEnumerator() | Sort-Object -Property Name | Select-Object Name,Value) | Add-WordTable -FilePath $FullDocumentationPath -AutoFitStyle Window -Design LightListAccent2
    
    }
    #endregion

    #region Apple Push Certificate
    Add-WordText -FilePath $FullDocumentationPath -Heading Heading1 -Text "Apple Configurations"
    Add-WordText -FilePath $FullDocumentationPath -Heading Heading2 -Text "Apple Push Certificate"
    $APNs = Get-IntuneApplePushNotificationCertificate

    foreach($APN in $APNs){
        write-Log "AutoPilot Config: $($APN.appleIdentifier)"
        Add-WordText -FilePath $FullDocumentationPath -Heading Heading3 -Text $APN.appleIdentifier
        
        $ht2 = @{}
        $APN.psobject.properties | ForEach-Object { 
            $ht2[(Format-MsGraphData $($_.Name))] = if((Format-MsGraphData "$($_.Value)").Length -gt $MaxStringLengthSettings){
                    "$((Format-MsGraphData "$($_.Value)").substring(0, $MaxStringLengthSettings))..."
                } else {
                    "$((Format-MsGraphData "$($_.Value)")) "
                }
        }
        ($ht2.GetEnumerator() | Sort-Object -Property Name | Select-Object Name,Value) | Add-WordTable -FilePath $FullDocumentationPath -AutoFitStyle Window -Design LightListAccent2
    
    }
    Add-WordText -FilePath $FullDocumentationPath -Heading Heading2 -Text "Apple VPP Tokens"
    $VPPs = Get-IntuneVppToken

    foreach($VPP in $VPPs){
        write-Log "VPP Config: $($VPP.appleId)"
        Add-WordText -FilePath $FullDocumentationPath -Heading Heading3 -Text $VPP.appleId
        
        $ht2 = @{}
        $VPP.psobject.properties | ForEach-Object { 
            $ht2[(Format-MsGraphData $($_.Name))] = if((Format-MsGraphData "$($_.Value)").Length -gt $MaxStringLengthSettings){
                    "$((Format-MsGraphData "$($_.Value)").substring(0, $MaxStringLengthSettings))..."
                } else {
                    "$((Format-MsGraphData "$($_.Value)")) "
                }
        }
        ($ht2.GetEnumerator() | Sort-Object -Property Name | Select-Object Name,Value) | Add-WordTable -FilePath $FullDocumentationPath -AutoFitStyle Window -Design LightListAccent2
    
    }
    #endregion

    #region Device Categories
    Add-WordText -FilePath $FullDocumentationPath -Heading Heading1 -Text "Device Categories"
    $Cats = Get-IntuneDeviceCategory
    write-Log "Device Categories: $($Cats.count)"
    foreach($Cat in $Cats){
    Add-WordText -FilePath $FullDocumentationPath -Text (" - " + $Cat.displayName) -Size 10
    }

    #endregion

    #region Exchange Connection
    Add-WordText -FilePath $FullDocumentationPath -Heading Heading1 -Text "Exchange Connector"
    $exch = Get-IntuneExchangeConnector
    write-Log "Exchange Connector: $($exch.serverName)"
    $ht2 = @{}
    $exch.psobject.properties | ForEach-Object { 
        $ht2[(Format-MsGraphData $($_.Name))] = if((Format-MsGraphData "$($_.Value)").Length -gt $MaxStringLengthSettings){
                "$((Format-MsGraphData "$($_.Value)").substring(0, $MaxStringLengthSettings))..."
            } else {
                "$((Format-MsGraphData "$($_.Value)")) "
            }
    }
    ($ht2.GetEnumerator() | Sort-Object -Property Name | Select-Object Name,Value) | Add-WordTable -FilePath $FullDocumentationPath -AutoFitStyle Window -Design LightListAccent2

    #endregion


    #General Settings
    # On Prem Cond Access Get-IntuneConditionalAccessSetting
    # MAM Settings



    #region Partner Configuration
    Add-WordText -FilePath $FullDocumentationPath -Heading Heading1 -Text "Partner Configuration"
    $partnerConfigs = Get-IntuneDeviceManagementPartner
    foreach($partnerConfig in $partnerConfigs){
        write-Log "Partner Config: $($partnerConfig.displayName)"
        Add-WordText -FilePath $FullDocumentationPath -Heading Heading2 -Text $partnerConfig.displayName
        $ht2 = @{}
        $partnerConfig.psobject.properties | ForEach-Object { 
            $ht2[(Format-MsGraphData $($_.Name))] = if((Format-MsGraphData "$($_.Value)").Length -gt $MaxStringLengthSettings){
                    "$((Format-MsGraphData "$($_.Value)").substring(0, $MaxStringLengthSettings))..."
                } else {
                    "$((Format-MsGraphData "$($_.Value)")) "
                }
        }
        ($ht2.GetEnumerator() | Sort-Object -Property Name | Select-Object Name,Value) | Add-WordTable -FilePath $FullDocumentationPath -AutoFitStyle Window -Design LightListAccent2
    
    }
    #endregion
    #endregion
    #region Finishing
    ########################################################
    Write-Log "Press Ctrl + A and then F9 to Update the table of contents and other dynamic fields in the Word document."
    Write-Log "End Script $Scriptname"
    #endregion
}
# SIG # Begin signature block
# MIIXxQYJKoZIhvcNAQcCoIIXtjCCF7ICAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUzAH2BVHoBafTGV9+yxzF3d5s
# ncSgghL4MIID7jCCA1egAwIBAgIQfpPr+3zGTlnqS5p31Ab8OzANBgkqhkiG9w0B
# AQUFADCBizELMAkGA1UEBhMCWkExFTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTEUMBIG
# A1UEBxMLRHVyYmFudmlsbGUxDzANBgNVBAoTBlRoYXd0ZTEdMBsGA1UECxMUVGhh
# d3RlIENlcnRpZmljYXRpb24xHzAdBgNVBAMTFlRoYXd0ZSBUaW1lc3RhbXBpbmcg
# Q0EwHhcNMTIxMjIxMDAwMDAwWhcNMjAxMjMwMjM1OTU5WjBeMQswCQYDVQQGEwJV
# UzEdMBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xMDAuBgNVBAMTJ1N5bWFu
# dGVjIFRpbWUgU3RhbXBpbmcgU2VydmljZXMgQ0EgLSBHMjCCASIwDQYJKoZIhvcN
# AQEBBQADggEPADCCAQoCggEBALGss0lUS5ccEgrYJXmRIlcqb9y4JsRDc2vCvy5Q
# WvsUwnaOQwElQ7Sh4kX06Ld7w3TMIte0lAAC903tv7S3RCRrzV9FO9FEzkMScxeC
# i2m0K8uZHqxyGyZNcR+xMd37UWECU6aq9UksBXhFpS+JzueZ5/6M4lc/PcaS3Er4
# ezPkeQr78HWIQZz/xQNRmarXbJ+TaYdlKYOFwmAUxMjJO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