Sectionning

This commit is contained in:
Dandaedre 2026-09-04 13:46:42 +02:00
parent c726bfa0f7
commit 26b1d0d797
1 changed files with 3 additions and 6 deletions

View File

@ -106,12 +106,8 @@ function Write-Section {
[scriptblock]$Script
)
$separator = '=' * 80
Write-Both $Writer ''
Write-Both $Writer $separator
Write-Both $Writer $Title
Write-Both $Writer $separator
Write-Both $Writer ('--- ' + $Title + ' ---')
try {
$result = & $Script 2>&1
@ -246,7 +242,8 @@ $computerName = $env:COMPUTERNAME
$reportName = 'windows_system_report_' + $computerName + '_' + $timestamp + '.txt'
$reportPath = Join-Path $OutputDirectory $reportName
$encoding = $encoding = [System.Text.Encoding]::ASCII
# $encoding = $encoding = [System.Text.Encoding]::ASCII
$encoding = New-Object System.Text.UTF8Encoding($false)
$writer = New-Object System.IO.StreamWriter($reportPath, $false, $encoding)
try {