프로그램 추가 / 제거 목록과 일치하는 설치된 응용 프로그램 목록 가져 오기

Aug 21 2020

고객의 컴퓨터에 설치된 모든 프로그램을 나열하는 응용 프로그램을 작업 중입니다. 레지스트리 키를 기반으로 한 목록을 얻을 수 있었지만 Microsoft Store를 통해 설치된 항목은 포함되어 있지 않습니다. PowerShell을 사용하는 것처럼 보입니다 (이 페이지의 지침에 따라 :https://mhelp.pro/how-to-uninstall-windows-apps/) 설치된 응용 프로그램 목록을 가져올 수 있지만 프로그램 추가 / 제거에없는 항목이 많이 포함 된 것 같습니다. 두 소스 (프로그램 추가 / 제거)를 조정하는 방법을 모르겠습니다. PowerShell을 통한 프로그램 목록). 이 작업을 수행하는 더 좋은 방법이 있습니까? 아니면 나열된 응용 프로그램이 프로그램 추가 / 제거에 있는지 확인하는 데 사용해야하는 플래그 또는 기준이 있습니까?

답변

1 Hackoo Aug 22 2020 at 08:59

그런 뜻일까요?

Windows에 설치된 프로그램 목록을 만드는 방법을 참조하십시오.


$outputFile = "$env:APPDATA\Installed_Applications.txt"
$OS_Architecture = $env:PROCESSOR_ARCHITECTURE
if($OS_Architecture -eq 'x86') { #write-host '32-bit' $key = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*"
}
else
{
    #write-host '64-bit'
    $key = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" } Get-ItemProperty $Key |
        Select-Object DisplayName, DisplayVersion, Publisher, InstallDate |
            Format-Table –AutoSize |
                Out-File $outputFile -Encoding UTF8 -Force Start-Process $outputFile

수정 : 25/08/2020 @ 18:20

다음은 관리자 권한으로 모든 것을 가져 오는 Self-elevate 스크립트입니다.

cls
# Self-elevate the script if required
if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {
  if ([int](Get-CimInstance -Class Win32_OperatingSystem | Select-Object -ExpandProperty BuildNumber) -ge 6000) {
      #$CommandLine = "-File `"" + $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments $CommandLine = $MyInvocation.InvocationName Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CommandLine
      Exit
     }
    }

$outputFile = "$env:APPDATA\Installed_Applications.txt"
$OS_Architecture = $env:PROCESSOR_ARCHITECTURE
if($OS_Architecture -eq 'x86') { #write-host '32-bit' $key = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*"
}
else
{
    #write-host '64-bit'
    $key = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" } Get-ItemProperty $Key |
        Select-Object DisplayName, DisplayVersion, Publisher, InstallDate |
            Format-Table –AutoSize | Out-String -Width 300 |
                Out-File $outputFile -Encoding UTF8 -Force Get-AppxPackage -AllUsers | Out-File -Append $outputFile -Encoding UTF8 -Force 
                            Start $outputFile
js2010 Aug 22 2020 at 19:29

powershell 5에서는 있지만 powershell 7에서는 그렇지 않습니다.

get-package