Functions/Common/Get-FileExtension.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function Get-FileExtension
{
    param(
        [Parameter(Mandatory=$True)]
        [string]$TypeName
    )
    switch ($TypeName)
    {
        'Report'     { return '.rdl' }
        'DataSource' { return '.rsds' }
        'DataSet'    { return '.rsd' }
        'MobileReport' { return '.rsmobile' }
        'PowerBIReport' { return '.pbix' }
        'ExcelWorkbook' { return '' }
        'Resource' { return '' }
        'Kpi' { return '.kpi' }
        default      { throw 'Unsupported item type! We only support items which are of type Report, DataSet, DataSource, Mobile Report or Power BI Report' }
    }
}