Fix Print?
This commit is contained in:
parent
f405235980
commit
2520b18ebe
|
|
@ -114,11 +114,17 @@ function Write-Section {
|
|||
Write-Both $Writer $separator
|
||||
|
||||
try {
|
||||
& $Script 2>&1 | ForEach-Object {
|
||||
$text = ($_ | Out-String -Width 240).TrimEnd()
|
||||
$result = & $Script 2>&1
|
||||
$text = $result | Out-String -Width 240
|
||||
|
||||
if (-not [string]::IsNullOrWhiteSpace($text)) {
|
||||
Write-Both $Writer $text
|
||||
if ([string]::IsNullOrWhiteSpace($text)) {
|
||||
Write-Both $Writer '(no output)'
|
||||
}
|
||||
else {
|
||||
$lines = $text.TrimEnd() -split "`r?`n"
|
||||
|
||||
foreach ($line in $lines) {
|
||||
Write-Both $Writer $line
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -126,7 +132,6 @@ function Write-Section {
|
|||
Write-Both $Writer ('ERROR: ' + $_.Exception.Message)
|
||||
}
|
||||
}
|
||||
|
||||
function Get-InstalledPrograms {
|
||||
$paths = @(
|
||||
'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*',
|
||||
|
|
|
|||
Loading…
Reference in New Issue