$desktopPath = [System.Environment]::GetFolderPath('Desktop') $installedPrograms = @() $registryPaths = @( "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*", "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" ) foreach ($path in $registryPaths) { if (Test-Path $path) { $installedPrograms += Get-ItemProperty -Path $path -ErrorAction SilentlyContinue } } $programList = $installedPrograms | Select-Object -ExpandProperty DisplayName -ErrorAction SilentlyContinue | Where-Object { $_ -match '\S' } $outputFile = "$desktopPath\programs.txt" $programList | Out-File -FilePath $outputFile -Encoding UTF8 Write-Host "Installed programs list saved to: $outputFile" Start-Sleep -Seconds 5