-
Notifications
You must be signed in to change notification settings - Fork 19
/
Set-CSVDelimiterForSSRS.ps1
48 lines (42 loc) · 1.39 KB
/
Set-CSVDelimiterForSSRS.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<#
.SYNOPSIS
Sets a custom field delimiter for CSV exports in SSRS running in SharePoint Integrated Mode
.DESCRIPTION
Sets a custom field delimiter for CSV exports in SSRS running in SharePoint Integrated Mode.
.NOTES
File Name: Set-CSVDelimiterForSSRS.ps1
Author : Bart Kuppens
Version : 1.0
.PARAMETER Delimiter
Specifies the custom delimiter
.EXAMPLE
PS > .\Set-CSVDelimiterForSSRS.ps1 -Delimiter ";"
#>
[CmdletBinding()]
param(
[parameter(Position=0,Mandatory=$true,ValueFromPipeline=$false,HelpMessage="Specifies the custom delimiter.")]
[string]$Delimiter
)
if ((Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null)
{
Write-Host "Loading SharePoint cmdlets..."
Add-PSSnapin Microsoft.SharePoint.PowerShell
}
if (Get-Command Get-SPRSServiceApplication -ErrorAction SilentlyContinue)
{
$SSRSApp = Get-SPRSServiceApplication
if ($SSRSApp -ne $null)
{
$csv = Get-SPRSExtension –identity $SSRSApp | ? {$_.Name –eq "CSV"}
$csv.ConfigurationXml = "<DeviceInfo><FieldDelimiter>$Delimiter</FieldDelimiter></DeviceInfo>"
$SSRSApp.Update()
}
else
{
Write-Host "The SQL Server Reporting Services application doesn't exist, halting execution."
}
}
else
{
Write-Host "SQL Server Reporting Services is not installed, halting execution."
}