Conversation
…m and Invoke-AsBuiltReport.Microsoft.AD
| # Forest Section | ||
| Get-AbrForestSection | ||
| if ($InfoLevel.Forest -ge 1) { | ||
| Write-Host '- Working on Forest section.' |
Check warning
Code scanning / PSScriptAnalyzer
File 'Invoke-AsBuiltReport.Microsoft.AD.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning
| # Domain Section | ||
| Get-AbrDomainSection -DomainStatus ([ref]$DomainStatus) | ||
| if ($InfoLevel.Domain -ge 1) { | ||
| Write-Host '- Working on Domain section.' |
Check warning
Code scanning / PSScriptAnalyzer
File 'Invoke-AsBuiltReport.Microsoft.AD.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning
| # DNS Section | ||
| Get-AbrDnsSection -DomainStatus ([ref]$DomainStatus) | ||
| if ($InfoLevel.DNS -ge 1) { | ||
| Write-Host '- Working on DNS section.' |
Check warning
Code scanning / PSScriptAnalyzer
File 'Invoke-AsBuiltReport.Microsoft.AD.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning
| # PKI Section | ||
| Get-AbrPKISection | ||
| if ($InfoLevel.CA -ge 1) { | ||
| Write-Host '- Working on PKI section.' |
Check warning
Code scanning / PSScriptAnalyzer
File 'Invoke-AsBuiltReport.Microsoft.AD.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning
| if ($Options.ExportDiagrams) { | ||
| Write-Host ' ' | ||
| Write-Host 'ExportDiagrams option enabled: Exporting diagrams:' | ||
| Write-Host '- ExportDiagrams option enabled: Exporting diagrams:' |
Check warning
Code scanning / PSScriptAnalyzer
File 'Invoke-AsBuiltReport.Microsoft.AD.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning
| # Connection Status Section # | ||
| #---------------------------------------------------------------------------------------------# | ||
|
|
||
| Write-Host "- Finished report generation for $RootDomains forest:" |
Check warning
Code scanning / PSScriptAnalyzer
File 'Invoke-AsBuiltReport.Microsoft.AD.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning
| if (Get-ValidDCfromDomain -Domain $Domain -DCStatus ([ref]$DCStatus)) { | ||
| try { | ||
| if ($DomainInfo = Invoke-CommandWithTimeout -Session $TempPssSession -ScriptBlock { Get-ADDomain -Identity $using:Domain }) { | ||
| Write-Host " - Collecting DNS information from $Domain." |
Check warning
Code scanning / PSScriptAnalyzer
File 'Get-AbrDNSSection.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning
| # Define Filter option for Domain variable | ||
| try { | ||
| if ($DomainInfo = Invoke-CommandWithTimeout -Session $TempPssSession -ScriptBlock { Get-ADDomain -Identity $using:Domain }) { | ||
| Write-Host " - Collecting Domain information from $Domain." |
Check warning
Code scanning / PSScriptAnalyzer
File 'Get-AbrDomainSection.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning
| [array]$RootDomains = $ADSystem.RootDomain | ||
| $RootDomains = $ADSystem.RootDomain | ||
| if ($Options.Include.Domains) { | ||
| Write-Host "- Include.Domains option enabled: Including only the following domains in the report: $($Options.Include.Domains -join ', ' )" |
Check warning
Code scanning / PSScriptAnalyzer
File 'Invoke-AsBuiltReport.Microsoft.AD.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning
| [array]$ChildDomains = $ADSystem.Domains | Where-Object { $_ -ne $RootDomains -and $_ -in $Options.Include.Domains } | ||
| } else { | ||
| } elseif ($Options.Exclude.Domains) { | ||
| Write-Host "- Including all child domains in the report except the following excluded domains: $($Options.Exclude.Domains -join ', ')" |
Check warning
Code scanning / PSScriptAnalyzer
File 'Invoke-AsBuiltReport.Microsoft.AD.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning
| $script:OrderedDomains = @() | ||
| $OrderedDomains += $RootDomains | ||
| Write-Host "- Getting $OrderedDomains forest information." | ||
| Write-Host "- Getting $RootDomains forest information." |
Check warning
Code scanning / PSScriptAnalyzer
File 'Invoke-AsBuiltReport.Microsoft.AD.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning
[0.9.11] - Unreleased
🧰 Added
🔃 Changed
0.9.111.6.1🐛 Fixed
❌ Removed