Загрузка данных



# Export running applications with window titles and executable paths
Get-Process |
    Where-Object {$_.MainWindowHandle -ne 0} |
    Select-Object ProcessName, Id, MainWindowTitle, Path |
    Format-Table -AutoSize |
    Out-String -Width 240 |
    Set-Content "$env:USERPROFILE\Desktop\visible_apps.txt" -Encoding UTF8

# Export processes without a visible main window
Get-Process |
    Where-Object {$_.MainWindowHandle -eq 0} |
    Select-Object ProcessName, Id, Path |
    Sort-Object ProcessName |
    Format-Table -AutoSize |
    Out-String -Width 240 |
    Set-Content "$env:USERPROFILE\Desktop\background_apps.txt" -Encoding UTF8

Write-Host "Application lists saved to Desktop"