Skip to main content

Winget - Export Param

Summary

The script offers the functionality to export the list of installed applications in both JSON and CSV formats using the winget export --output $Export --include-versions command.

Additionally, it includes an option to email the generated report(s). By default, the script creates a JSON report. If the Export_CSV parameter is enabled, a corresponding CSV report will also be generated.

When the Email_Report parameter is set to 1, the script will send out the generated report(s) via email. By default, the report(s) will be sent to the user running the script unless a specific email address is provided in the Email_Address user parameter.

If both Export_CSV and Email_Report parameters are enabled, the script will send two separate emails, each attaching the corresponding report. This is because multiple files cannot be attached to the same email from Automate.

Path to the reports on the local machine:

  • C:/ProgramData/_Automation/Script/Invoke-WingetProcessor/Softwarelist.json
  • C:/ProgramData/_Automation/Script/Invoke-WingetProcessor/Softwarelist.csv

Requirement: PowerShell v5+

Sample Run

Example 1: Export and place the Softwarelist.json file at C:/ProgramData/_Automation/Script/Invoke-WingetProcessor/Softwarelist.json on the end machine.

Example 1

Example 2: Export and place both software.json and software.csv files respectively at C:/ProgramData/_Automation/Script/Invoke-WingetProcessor/Softwarelist.json and C:/ProgramData/_Automation/Script/Invoke-WingetProcessor/Softwarelist.csv on the end machine. Send out the reports to the user running the script via separate emails.

Example 2

Example 3: Export and place both software.json and software.csv files respectively at C:/ProgramData/_Automation/Script/Invoke-WingetProcessor/Softwarelist.json and C:/ProgramData/_Automation/Script/Invoke-WingetProcessor/Softwarelist.csv on the end machine. Send out the reports to support@provaltech.com via separate emails.

Example 3

User Parameters

NameExampleRequiredDescription
Export_CSV1FalseIf the parameter is set to 1, the script will generate a corresponding CSV report as well. By default, the script is configured to generate a JSON report only.
Email_Report1FalseIf the parameter is set to 1, the script will send the report(s) to the user running the script through email(s).
Email_Addresssupport@provaltech.comFalseIf email addresses are provided, the script will send the report(s) to the specified email address(es) instead of the user running the script. Multiple email addresses can be set by separating them with a semicolon ';' without any space. Example: support@provaltech.com;Alerts@provaltech.com

Output

  • Script logs
  • Email(s) (if enabled)