Plugins/Report.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 24-Sep-2016.

param(
    $Info,
    [string] $Type = 'markdown',
    [string] $Path = 'Update-AUPackages.md',
    [HashTable] $Params
)

Write-Host "Saving $Type report: $Path"

$Type = "$PSScriptRoot\Report\$Type.ps1"
if (!(Test-Path $Type )) { throw "Report type not found: '$Type" }

$result = & $Type
$result | Out-File $Path