首页 > 解决方案 > PowerShell 在同一行显示属性

问题描述

我正在尝试输出以下属性,但它在同一行中显示所有属性。任何想法我做错了什么?

##################### Removes office installations #####################

$RegPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"

$apps = Get-ChildItem -Path $RegPath | Get-ItemProperty 

$search = Read-Host -Prompt "Enter the name of application you want to uninstall: "

$apps365 = $apps | Where-Object { $_.DisplayName -Match "$search" | Sort-Object DisplayName | Format-Table }

Write-Host $apps365

标签: powershell

解决方案


原来我需要Format-Table$apps365变量中删除


推荐阅读