Tech News

PowerShell for Beginners: Creating Your Own Windows Scripts with AI


Read the names, version numbers, and manufacturers of the installed desktop programs. Sort the list alphabetically by program name and export it to a CSV file on the desktop.

Many traditional desktop applications store their details in the Windows Registry. You can create the following script example — or something similar — using the customized basic prompt (or simply copy it from here). It reads entries and saves the results to a file on the desktop:

$paths = @(
    "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*",
    "HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*",
    "HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*"
)

$desktop = [Environment]::GetFolderPath("Desktop")

Get-ItemProperty $paths -ErrorAction SilentlyContinue |
    Where-Object { $_.DisplayName } |
    Select-Object @{Name="Programme Name"; Expression={$_.DisplayName}},
                  @{Name="Version"; Expression={$_.DisplayVersion}},
                  @{Name="Publisher"; Expression={$_.Publisher}} |
    Sort-Object Programme Name |
    Export-Csv "$desktop\Installed-Programmes.csv" -NoTypeInformation -Encoding UTF8 -Delimiter ";"

Explanation: The three registry paths cover system-wide 64-bit and 32-bit programs, as well as applications registered only for the current user account. DisplayName, DisplayVersion, and Publisher refer to the program name, version number, and publisher. Export-Csv saves the details to the file ‘Installed-Programs.csv’. The semicolon as a delimiter makes it easier to split the data into columns in a spreadsheet.

How to use the tool: Open PowerShell, copy the entire code into the console window, and press Enter. You will then find the file ‘Installed-Programs.csv’ on your desktop. You can open it in Excel, for example.

Tip: The list provides an overview of many classic desktop programmes. It includes applications that store their installation data in the Windows Registry. However, apps from the Microsoft Store or portable programmes may be missing if they do not create corresponding entries there.

KSR

Hi there! I am the Founder of Cyber World Technologies. My skills include Android, Firebase, Python, PHP, and a lot more. If you have a project that you'd like me to work on, please let me know: contact@cyberworldtechnologies.co.in

Related Articles

Back to top button