New-RepositoryReport



Summary

Creates a report from a repository directory

Syntax

New-RepositoryReport [[-Format] <String>] [[-RepositoryPath] <DirectoryInfo>] [[-OutputFile] <FileInfo>] [<CommonParameters>]

Description

This command creates a report from a repository directory or any directory containing CVAs (and EXEs) in one of the supported formats.

The supported formats are:

  • XML: Returns an XML object
  • JSON: Returns a JSON document
  • CSV: Returns a CSV object
  • ExcelCSV: Returns a CSV object containing an Excel hint that defines the comma character as the delimiter. Use this format only if you plan on opening the CSV file with Excel.

If a format is not specified, this command will return the output as PowerShell objects to the pipeline. Please note that the repository directory must contain CVAs for the command to generate a report successfully. EXEs are not required, but the EXEs will allow information like the time of download and size in bytes to be included in the report.

Parameters

Name Argument Description
Format <String> Specifies the output format (CSV, JSON, or XML) of the report. If not specified, this command will return the output as PowerShell objects.
RepositoryPath <DirectoryInfo> Specifies a different location for the repository. By default, this command assumes the repository is the current directory.
OutputFile <FileInfo> Specifies a file to write the output to. You can specify a relative path or an absolute path. If a relative path is specified, the file will be written relative to the current directory and if RepositoryPath parameter is also specified, the file will still be written relative to the current directory and not relative to the value in RepositoryPath.
This parameter requires the -Format parameter to also be specified.
If specified, this command will create the file (if it does not exist) and write the output to the file instead of returning the output as a PowerShell, XML, CSV, or JSON object.
Please note that if the output file already exists, the contents of the file will be overwritten.

Notes

This command currently supports scenarios where the SoftPaq executable is stored under the format sp.exe.

Examples


PS C:\> New-RepositoryReport -Format JSON -RepositoryPath c:\myrepository\softpaqs -OutputFile c:\repository\today.json

PS C:\> New-RepositoryReport -Format ExcelCSV -RepositoryPath c:\myrepository\softpaqs -OutputFile c:\repository\today.csv