通过 PowerShell 将所有已安装的软件归为一个单元 [英] group all installed software in one cell by PowerShell

查看:69
本文介绍了通过 PowerShell 将所有已安装的软件归为一个单元的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我们网络上的所有 PC 上都运行了 PowerShell 脚本,并从 PC 获取信息并将其保存在 CSV 文件中,并每次将新 PC 作为新行更新文件.

I have PowerShell script run on all PC on our network and get info from PC and save it in CSV file and update the file each time with new pc as a new row.

$logData = @(
                           [pscustomobject]@{
                            ComputerName = $ComputerName
                            IPAddress = $env:HostIP
                            User = $User
                            Email = $Email
                            ProgramsInstalled = $ProgramsInstalled
                            }
                           )
                     $logData | Export-Csv $csv -Encoding UTF8 -Append -NoTypeInformation -Force

我使用此代码来安装电脑上的所有软件

I use this code to get all software installed on the pc

$ProgramsInstalled = (Get-ItemProperty 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*','HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*') | Select-Object DisplayName

我没有获得所有软件,但是当我单独运行它并将其保存在一个 csv 文件中时,我会连续获得每个软件.

I did not get all software but when I run it alone and save it in a csv file I get the software each one of them in a row.

我希望它们组合在一个单元格中

I want them grouped in one cell

推荐答案

如果您愿意,可以使用 Get-Package:

You can use Get-Package if you like:

(Get-Package | Where-Object {$_.ProviderName -in @('Programs','msi','Chocolatey')} | Select-Object -ExpandProperty Name) -join ","

输出如下:

Microsoft DCF MUI (English) 2013,Microsoft OneNote MUI (English) 2013,Microsoft Office 32-bit Components 2013,Microsoft Office Shared 32-bit MUI (English) 2013,Microsoft Office OSM MUI (English) 2013,Microsoft Office OSM UX MUI (English) 2013,Microsoft InfoPath MUI (English) 2013,Microsoft Access MUI (English) 2013,Microsoft Office Shared Setup Metadata MUI (English) 2013,Microsoft Excel MUI (English) 2013,Microsoft Access Setup Metadata MUI (English) 2013,Microsoft PowerPoint MUI (English) 2013,Microsoft Publisher MUI (English) 2013,Microsoft Outlook MUI (English) 2013,Microsoft Groove MUI (English) 2013,Microsoft Word MUI (English) 2013,Microsoft Lync MUI (English) 2013,Microsoft Office Proofing (English) 2013,Microsoft Office Shared MUI (English) 2013,Microsoft Office Proofing Tools 2013 - English,Microsoft Office Proofing Tools 2013 - Español,Outils de vérification linguistique 2013 de Microsoft Office - Français,Microsoft Office Professional Plus 2013,Microsoft Office Professional Plus 2013,PowerShell 6-x86,Microsoft Visual C++ 2008 Redistributable - x64 9.0.30729.4148,TortoiseGit 2.10.0.2 (64 bit),Microsoft Visual C++ 2008 Redistributable - x64 9.0.21022,Google Toolbar for Internet Explorer,Google Toolbar for Internet Explorer,PowerShell 7-x64,Microsoft Visual C++ 2013 x86 Minimum Runtime - 12.0.21005,Google Drive,Microsoft Visual C++ 2013 x86 Additional Runtime - 12.0.21005,Intel(R) Management Engine Components,Intel(R) Management Engine Components,Thunderbolt(TM) Software,LibreOffice 6.4.5.2,Fast Boot,Fast Boot,GameCtrl B15.0803.1,GameCtrl B15.0803.1,Classic Shell,Python 3.4.0,SIV,SIV,AES Crypt,Oracle VM VirtualBox 5.2.6,EasyTune,EasyTune,Microsoft Visual C++ 2019 X86 Additional Runtime - 14.25.28508,paint.net,@BIOS B15.0630.1,@BIOS B15.0630.1,APP Center,APP Center,Adobe Reader XI (11.0.02),EZSetup B15.0623.1,EZSetup B15.0623.1,PuTTY release 0.73,Cloud Station Server,Cloud Station Server,Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.6161,BlueStacks Notification Center,ON_OFF Charge 2 B14.0217.1,ON_OFF Charge 2 B14.0217.1,Splashtop Streamer,Splashtop Streamer,PowerToys (Preview),Google Update Helper,Smart TimeLock B15.0626.1,Smart TimeLock B15.0626.1,VMware Player,Microsoft Visual C++ 2005 Redistributable,Intel(R) ME UninstallLegacy,BUSB,Intel(R) Rapid Storage Technology,Intel(R) Rapid Storage Technology,Microsoft Visual C++ 2019 X86 Minimum Runtime - 14.25.28508,Splashtop Remote Client,Splashtop Remote Client,Intel(R) Chipset Device Software,ConEmu 200615.x64,Microsoft Robocopy GUI,WinHide,OpenOffice.org 3.2,Metasploit-framework v5.0.94,Windows Driver Package - Realtek Semiconductor Corp. Net  (06/30/2014 1026.12.0606.2014),ShareX,AutoHotkey 1.1.32.00,CCleaner,EaseUS Data Recovery Wizard,Greenshot 1.2.10.6,IrfanView 4.54 (64-bit),Listary version 5.00,LockHunter 3.3, 32/64 bit,Mozilla Firefox 79.0 (x64 en-US),Mozilla Maintenance Service,Recuva,Sandboxie 5.22 (64-bit),Speccy,VLC media player,WinRAR 5.91 (64-bit),Bat To Exe Converter version 2.3.1,Microsoft Visual Studio Installer,Remo Recover 5.0,Quick Access Popup v10.5.1,Microsoft OneDrive,010 Editor 10.0.2 (32-bit),7-Zip 19.00,Adobe Flash Player 32 NPAPI,AnyBurn,Audacity 2.4.1,Auto-Patcher for Windows 98se June 2007 sp2,Avro Keyboard 4.5.1,Batchrun,BlueStacks App Player,Breevy 3.37,Cain & Abel 4.9.56,Dev-C++,EaseUS Partition Master 14.0,Everything 1.4.1.969 (x86),FileZilla Server,Git version 2.25.0,OpenGL Extensions Viewer 6.1,Google Chrome,HandBrake 1.3.3,Hidden Start,ImgBurn,Inno Setup version 6.0.5,JDownloader 2,Magical Jelly Bean KeyFinder,KGB Archiver 1.2.1.24,K-Lite Mega Codec Pack 4.0.0,LastPass (uninstall only),Microsoft Edge,Microsoft Edge Update,Mozilla Thunderbird 78.1.1 (x86 en-US),Nmap 7.80,Notepad++ (32-bit x86),Npcap,Orbit Downloader,qBittorrent 4.2.5,Resource Hacker Version 5.1.7,Revo Uninstaller 1.95,Smart Backup,Supercopier 1.2.3.2,Tweak UI,USB Virus Scan 2.4,WiFi Password Revealer,Winamp,WinCDEmu,WinPcap 4.1.3,WinSCP 5.17.6,WinThruster v6.9.1,Wireshark 3.2.4 32-bit,SHAREit,Yahoo! Messenger,UAS&TURBO DRIVER CONTROL TOOL 1.0.0.13,My Program 2 version 1.5,Qualcomm Atheros SmartNet Controller,Platform4 Player,Test version 1.5,Platform4 Player ActiveX Control,Microsoft Visual C++ 2015-2019 Redistributable (x86) - 14.25.28508,WhatPulse version 2.8.4,My Program version 1.5,LanOptimizer,Smart Recovery 2 B15.0626.1  (x64),Microsoft Visual C++ 2013 Redistributable (x86) - 12.0.21005,Intel(R) Processor Graphics,Realtek High Definition Audio Driver,My Program 3 version 1.5

或不带 -join ","

Microsoft DCF MUI (English) 2013
Microsoft OneNote MUI (English) 2013
Microsoft Office 32-bit Components 2013
Microsoft Office Shared 32-bit MUI (English) 2013
Microsoft Office OSM MUI (English) 2013
Microsoft Office OSM UX MUI (English) 2013
Microsoft InfoPath MUI (English) 2013
Microsoft Access MUI (English) 2013
Microsoft Office Shared Setup Metadata MUI (English) 2013
Microsoft Excel MUI (English) 2013
Microsoft Access Setup Metadata MUI (English) 2013
Microsoft PowerPoint MUI (English) 2013
Microsoft Publisher MUI (English) 2013
Microsoft Outlook MUI (English) 2013
Microsoft Groove MUI (English) 2013
Microsoft Word MUI (English) 2013
Microsoft Lync MUI (English) 2013
Microsoft Office Proofing (English) 2013
Microsoft Office Shared MUI (English) 2013
Microsoft Office Proofing Tools 2013 - English
Microsoft Office Proofing Tools 2013 - Español
Outils de vérification linguistique 2013 de Microsoft Office - Français
Microsoft Office Professional Plus 2013
Microsoft Office Professional Plus 2013
PowerShell 6-x86
Microsoft Visual C++ 2008 Redistributable - x64 9.0.30729.4148
TortoiseGit 2.10.0.2 (64 bit)
Microsoft Visual C++ 2008 Redistributable - x64 9.0.21022
Google Toolbar for Internet Explorer
Google Toolbar for Internet Explorer
PowerShell 7-x64
Microsoft Visual C++ 2013 x86 Minimum Runtime - 12.0.21005
Google Drive
Microsoft Visual C++ 2013 x86 Additional Runtime - 12.0.21005
Intel(R) Management Engine Components
Intel(R) Management Engine Components
Thunderbolt(TM) Software
LibreOffice 6.4.5.2
Fast Boot
Fast Boot
GameCtrl B15.0803.1
GameCtrl B15.0803.1
Classic Shell
Python 3.4.0
SIV
SIV
AES Crypt
Oracle VM VirtualBox 5.2.6
EasyTune
EasyTune
Microsoft Visual C++ 2019 X86 Additional Runtime - 14.25.28508
paint.net
@BIOS B15.0630.1
@BIOS B15.0630.1
APP Center
APP Center
Adobe Reader XI (11.0.02)
EZSetup B15.0623.1
EZSetup B15.0623.1
PuTTY release 0.73
Cloud Station Server
Cloud Station Server
Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.6161
BlueStacks Notification Center
ON_OFF Charge 2 B14.0217.1
ON_OFF Charge 2 B14.0217.1
Splashtop Streamer
Splashtop Streamer
PowerToys (Preview)
Google Update Helper
Smart TimeLock B15.0626.1
Smart TimeLock B15.0626.1
VMware Player
Microsoft Visual C++ 2005 Redistributable
Intel(R) ME UninstallLegacy
BUSB
Intel(R) Rapid Storage Technology
Intel(R) Rapid Storage Technology
Microsoft Visual C++ 2019 X86 Minimum Runtime - 14.25.28508
Splashtop Remote Client
Splashtop Remote Client
Intel(R) Chipset Device Software
ConEmu 200615.x64
Microsoft Robocopy GUI
WinHide
OpenOffice.org 3.2
Metasploit-framework v5.0.94
Windows Driver Package - Realtek Semiconductor Corp. Net  (06/30/2014 1026.12.0606.2014)
ShareX
AutoHotkey 1.1.32.00
CCleaner
EaseUS Data Recovery Wizard
Greenshot 1.2.10.6
IrfanView 4.54 (64-bit)
Listary version 5.00
LockHunter 3.3, 32/64 bit
Mozilla Firefox 79.0 (x64 en-US)
Mozilla Maintenance Service
Recuva
Sandboxie 5.22 (64-bit)
Speccy
VLC media player
WinRAR 5.91 (64-bit)
Bat To Exe Converter version 2.3.1
Microsoft Visual Studio Installer
Remo Recover 5.0
Quick Access Popup v10.5.1
Microsoft OneDrive
010 Editor 10.0.2 (32-bit)
7-Zip 19.00
Adobe Flash Player 32 NPAPI
AnyBurn
Audacity 2.4.1
Auto-Patcher for Windows 98se June 2007 sp2
Avro Keyboard 4.5.1
Batchrun
BlueStacks App Player
Breevy 3.37
Cain & Abel 4.9.56
Dev-C++
EaseUS Partition Master 14.0
Everything 1.4.1.969 (x86)
FileZilla Server
Git version 2.25.0
OpenGL Extensions Viewer 6.1
Google Chrome
HandBrake 1.3.3
Hidden Start
ImgBurn
Inno Setup version 6.0.5
JDownloader 2
Magical Jelly Bean KeyFinder
KGB Archiver 1.2.1.24
K-Lite Mega Codec Pack 4.0.0
LastPass (uninstall only)
Microsoft Edge
Microsoft Edge Update
Mozilla Thunderbird 78.1.1 (x86 en-US)
Nmap 7.80
Notepad++ (32-bit x86)
Npcap
Orbit Downloader
qBittorrent 4.2.5
Resource Hacker Version 5.1.7
Revo Uninstaller 1.95
Smart Backup
Supercopier 1.2.3.2
Tweak UI
USB Virus Scan 2.4
WiFi Password Revealer
Winamp
WinCDEmu
WinPcap 4.1.3
WinSCP 5.17.6
WinThruster v6.9.1
Wireshark 3.2.4 32-bit
SHAREit
Yahoo! Messenger
UAS&TURBO DRIVER CONTROL TOOL 1.0.0.13
My Program 2 version 1.5
Qualcomm Atheros SmartNet Controller
Platform4 Player
Test version 1.5
Platform4 Player ActiveX Control
Microsoft Visual C++ 2015-2019 Redistributable (x86) - 14.25.28508
WhatPulse version 2.8.4
My Program version 1.5
LanOptimizer
Smart Recovery 2 B15.0626.1  (x64)
Microsoft Visual C++ 2013 Redistributable (x86) - 12.0.21005
Intel(R) Processor Graphics
Realtek High Definition Audio Driver
My Program 3 version 1.5

这篇关于通过 PowerShell 将所有已安装的软件归为一个单元的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆