Technology

PowerShell for Freshmen: Creating Your Personal Home windows Scripts with AI

Learn the names, model numbers, and producers of the put in desktop packages. Kind the checklist alphabetically by program identify and export it to a CSV file on the desktop.

Many conventional desktop purposes retailer their particulars within the Home windows Registry. You’ll be able to create the next script instance — or one thing related — utilizing the personalized fundamental immediate (or just copy it from right here). It reads entries and saves the outcomes to a file on the desktop:

$paths = @(
    "HKLM:SoftwareMicrosoftWindowsCurrentVersionUninstall*",
    "HKLM:SoftwareWOW6432NodeMicrosoftWindowsCurrentVersionUninstall*",
    "HKCU:SoftwareMicrosoftWindowsCurrentVersionUninstall*"
)

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

Get-ItemProperty $paths -ErrorAction SilentlyContinue |
    The place-Object { $_.DisplayName } |
    Choose-Object @{Identify="Programme Identify"; Expression={$_.DisplayName}},
                  @{Identify="Model"; Expression={$_.DisplayVersion}},
                  @{Identify="Writer"; Expression={$_.Writer}} |
    Kind-Object Programme Identify |
    Export-Csv "$desktopInstalled-Programmes.csv" -NoTypeInformation -Encoding UTF8 -Delimiter ";"

Clarification: The three registry paths cowl system-wide 64-bit and 32-bit packages, in addition to purposes registered just for the present person account. DisplayName, DisplayVersion, and Writer confer with this system identify, model quantity, and writer. Export-Csv saves the main points to the file ‘Put in-Applications.csv’. The semicolon as a delimiter makes it simpler to separate the info into columns in a spreadsheet.

How you can use the software: Open PowerShell, copy all the code into the console window, and press Enter. You’ll then discover the file ‘Put in-Applications.csv’ in your desktop. You’ll be able to open it in Excel, for instance.

Tip: The checklist gives an outline of many basic desktop programmes. It consists of purposes that retailer their set up knowledge within the Home windows Registry. Nevertheless, apps from the Microsoft Retailer or transportable programmes could also be lacking if they don’t create corresponding entries there.