Functions/Common/Get-FileExtension.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function Get-FileExtension
{
    param(
        [Parameter(Mandatory=$True)]
        [string]$TypeName
    )
    switch ($TypeName)
    {
        'Report'     { return '.rdl' }
        'DataSource' { return '.rsds' }
        'DataSet'    { return '.rsd' } 
        default      {throw 'Unsupported item type! We only support items which are of type Report, DataSet or DataSource'}
    }
}