3030 Override existing catalog item.
3131
3232. EXAMPLE
33- Write-RsCatalogItem -ReportServerUri http://localhost/reportserver_sql2012 -Path c:\reports\monthlyreport.rdl -Destination /financereports
33+ Write-RsCatalogItem -ReportServerUri http://localhost/reportserver_sql2012 -Path c:\reports\monthlyreport.rdl -RsFolder /financereports
3434
3535 Description
3636 -----------
3737 Uploads the report monthlyreport.rdl to folder /financereports
3838
3939. EXAMPLE
40- Write-RsCatalogItem -ReportServerUri 'http://localhost/reportserver_sql2012' -Path c:\reports\monthlyreport.rdl, c:\reports\dailyreport.rdl -Destination /financereports
40+ Write-RsCatalogItem -ReportServerUri 'http://localhost/reportserver_sql2012' -Path c:\reports\monthlyreport.rdl, c:\reports\dailyreport.rdl -RsFolder /financereports
4141
4242 Description
4343 -----------
4444 Uploads the monthlyreport.rdl and dailyreport.rdl report to folder /financereports
4545
4646. EXAMPLE
47- Write-RsCatalogItem -ReportServerUri 'http://localhost/reportserver_sql2012' -Path ( dir c:\reports -filter *.rdl) -Destination /financereports
47+ Write-RsCatalogItem -ReportServerUri 'http://localhost/reportserver_sql2012' -Path ( dir c:\reports -filter *.rdl) -RsFolder /financereports
4848
4949 Description
5050 -----------
@@ -68,9 +68,10 @@ function Write-RsCatalogItem
6868 [string []]
6969 $Path ,
7070
71+ [Alias (' Destination' )]
7172 [Parameter (Mandatory = $True )]
7273 [string ]
73- $Destination ,
74+ $RsFolder ,
7475
7576 [Alias (' Override' )]
7677 [switch ]
@@ -101,13 +102,13 @@ function Write-RsCatalogItem
101102 $itemName = $item.BaseName
102103
103104
104- if ($Destination -eq " /" )
105+ if ($RsFolder -eq " /" )
105106 {
106107 Write-Verbose " Uploading $EntirePath to /$ ( $itemName ) "
107108 }
108109 else
109110 {
110- Write-Verbose " Uploading $EntirePath to $Destination /$ ( $itemName ) "
111+ Write-Verbose " Uploading $EntirePath to $RsFolder /$ ( $itemName ) "
111112 }
112113
113114 if ($itemType -eq ' DataSource' )
@@ -123,7 +124,7 @@ function Write-RsCatalogItem
123124 $enabled = $content.DataSourceDefinition.Enabled
124125 $credentialRetrieval = ' None'
125126
126- $newDataSourceCmd = " New-RsDataSource -Destination $Destination -Name $itemName -Extension $extension -CredentialRetrieval $credentialRetrieval "
127+ $newDataSourceCmd = " New-RsDataSource -RsFolder $RsFolder -Name $itemName -Extension $extension -CredentialRetrieval $credentialRetrieval "
127128
128129 if (! [String ]::IsNullOrEmpty($connectionString ))
129130 {
@@ -134,33 +135,33 @@ function Write-RsCatalogItem
134135 {
135136 if ($enabled -eq $false )
136137 {
137- New-RsDataSource - Proxy $Proxy - Destination $Destination - Name $itemName - Extension $extension - ConnectionString $connectionString - CredentialRetrieval $credentialRetrieval - Disabled - Overwrite | Out-Null
138+ New-RsDataSource - Proxy $Proxy - RsFolder $RsFolder - Name $itemName - Extension $extension - ConnectionString $connectionString - CredentialRetrieval $credentialRetrieval - Disabled - Overwrite | Out-Null
138139 }
139140 else
140141 {
141- New-RsDataSource - Proxy $Proxy - Destination $Destination - Name $itemName - Extension $extension - ConnectionString $connectionString - CredentialRetrieval $credentialRetrieval - Overwrite | Out-Null
142+ New-RsDataSource - Proxy $Proxy - RsFolder $RsFolder - Name $itemName - Extension $extension - ConnectionString $connectionString - CredentialRetrieval $credentialRetrieval - Overwrite | Out-Null
142143 }
143144 }
144145 else
145146 {
146147 if ($enabled -eq $false )
147148 {
148- New-RsDataSource - Proxy $Proxy - Destination $Destination - Name $itemName - Extension $extension - ConnectionString $connectionString - CredentialRetrieval $credentialRetrieval - Disabled | Out-Null
149+ New-RsDataSource - Proxy $Proxy - RsFolder $RsFolder - Name $itemName - Extension $extension - ConnectionString $connectionString - CredentialRetrieval $credentialRetrieval - Disabled | Out-Null
149150 }
150151 else
151152 {
152- New-RsDataSource - Proxy $Proxy - Destination $Destination - Name $itemName - Extension $extension - ConnectionString $connectionString - CredentialRetrieval $credentialRetrieval | Out-Null
153+ New-RsDataSource - Proxy $Proxy - RsFolder $RsFolder - Name $itemName - Extension $extension - ConnectionString $connectionString - CredentialRetrieval $credentialRetrieval | Out-Null
153154 }
154155 }
155156 }
156157 else
157158 {
158159 $bytes = [System.IO.File ]::ReadAllBytes($EntirePath )
159160 $warnings = $null
160- $Proxy.CreateCatalogItem ($itemType , $itemName , $Destination , $OverWrite , $bytes , $null , [ref ]$warnings ) | Out-Null
161+ $Proxy.CreateCatalogItem ($itemType , $itemName , $RsFolder , $OverWrite , $bytes , $null , [ref ]$warnings ) | Out-Null
161162 }
162163
163- Write-Information " $EntirePath was uploaded to $Destination successfully!"
164+ Write-Information " $EntirePath was uploaded to $RsFolder successfully!"
164165 }
165166 }
166167}
0 commit comments