Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e9aa0db

Browse files
Replaced -Destination DestinationFolder parameters in favor of -RsFolder for increased clarity
Replaced -Destination DestinationFolder parameters in favor of -RsFolder for increased clarity; added aliases to reference these previous commands. Modified Help examples with these changes as well.
1 parent 39a8160 commit e9aa0db

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

‎Functions/CatalogItems/Write-RsCatalogItem.ps1‎

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,21 @@
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
}

‎Functions/CatalogItems/Write-RsFolderContent.ps1‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
Folder on reportserver to upload the item to.
2828
2929
.EXAMPLE
30-
Write-RsFolderContent -ReportServerUri 'http://localhost/reportserver_sql2012' -Path c:\monthlyreports -DestinationFolder /monthlyReports
30+
Write-RsFolderContent -ReportServerUri 'http://localhost/reportserver_sql2012' -Path c:\monthlyreports -RsFolder /monthlyReports
3131
3232
Description
3333
-----------
@@ -51,9 +51,10 @@ function Write-RsFolderContent()
5151
[string]
5252
$Path,
5353

54+
[Alias('DestinationFolder')]
5455
[Parameter(Mandatory=$True)]
5556
[string]
56-
$DestinationFolder
57+
$RsFolder
5758
)
5859

5960
if(-not $Proxy)
@@ -67,7 +68,7 @@ function Write-RsFolderContent()
6768
throw "$Path is not a folder"
6869
}
6970

70-
# Write-Verbose "Creating folder $DestinationFolder"
71+
# Write-Verbose "Creating folder $RsFolder"
7172
# $Proxy.CreateFolder($sourceFolder.Name, $Destination, $null) | Out-Null
7273

7374
if($Recurse) { $items = Get-ChildItem $Path -Recurse } else { $items = Get-ChildItem $Path }
@@ -78,13 +79,13 @@ function Write-RsFolderContent()
7879
$relativePath = Clear-Substring -string $item.FullName -substring $sourceFolder.FullName.TrimEnd("\") -position front
7980
$relativePath = Clear-Substring -string $relativePath -substring ("\" + $item.Name) -position back
8081
$relativePath = $relativePath.replace("\", "/")
81-
if($DestinationFolder -eq "/" -and $relativePath -ne "")
82+
if($RsFolder -eq "/" -and $relativePath -ne "")
8283
{
8384
$parentFolder = $relativePath
8485
}
8586
else
8687
{
87-
$parentFolder = $DestinationFolder + $relativePath
88+
$parentFolder = $RsFolder + $relativePath
8889
}
8990

9091
Write-Verbose "Creating folder $parentFolder/$($item.Name)"
@@ -99,13 +100,13 @@ function Write-RsFolderContent()
99100
$relativePath = Clear-Substring -string $relativePath -substring ("\" + $item.Name) -position back
100101
$relativePath = $relativePath.replace("\", "/")
101102

102-
if($DestinationFolder -eq "/" -and $relativePath -ne "")
103+
if($RsFolder -eq "/" -and $relativePath -ne "")
103104
{
104105
$parentFolder = $relativePath
105106
}
106107
else
107108
{
108-
$parentFolder = $DestinationFolder + $relativePath
109+
$parentFolder = $RsFolder + $relativePath
109110
}
110111

111112
Write-RsCatalogItem -proxy $Proxy -Path $item.FullName -Destination $parentFolder

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /