From 21bdf333447a337be8fc15ff1c3acfa7e46df820 Mon Sep 17 00:00:00 2001 From: Lloyd Date: Mon, 15 Jul 2019 18:13:23 +0800 Subject: [PATCH 1/4] Fix key access for namespaces and keys with spaces --- .../Functions/CatalogItems/New-RsDataSource.ps1 | 2 +- .../Functions/CatalogItems/New-RsFolder.ps1 | 2 +- .../Functions/CatalogItems/Write-RsCatalogItem.ps1 | 2 +- .../Functions/Common/ConnectionObjectRequests.ps1 | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ReportingServicesTools/Functions/CatalogItems/New-RsDataSource.ps1 b/ReportingServicesTools/Functions/CatalogItems/New-RsDataSource.ps1 index e76ac359..74da5bd7 100644 --- a/ReportingServicesTools/Functions/CatalogItems/New-RsDataSource.ps1 +++ b/ReportingServicesTools/Functions/CatalogItems/New-RsDataSource.ps1 @@ -205,7 +205,7 @@ function New-RsDataSource throw (New-Object System.Exception("Exception occurred while converting credential retrieval to enum! $($_.Exception.Message)", $_.Exception)) } - $additionalProperties = New-Object System.Collections.Generic.List[$propertyDataType] + $additionalProperties = New-Object System.Collections.Generic.List["$propertyDataType"] if ($Description) { $descriptionProperty = New-Object $propertyDataType diff --git a/ReportingServicesTools/Functions/CatalogItems/New-RsFolder.ps1 b/ReportingServicesTools/Functions/CatalogItems/New-RsFolder.ps1 index 54c0cdbc..45bf3205 100644 --- a/ReportingServicesTools/Functions/CatalogItems/New-RsFolder.ps1 +++ b/ReportingServicesTools/Functions/CatalogItems/New-RsFolder.ps1 @@ -88,7 +88,7 @@ function New-RsFolder $namespace = $proxy.GetType().Namespace $propertyDataType = "$namespace.Property" - $additionalProperties = New-Object System.Collections.Generic.List[$propertyDataType] + $additionalProperties = New-Object System.Collections.Generic.List["$propertyDataType"] if ($Description) { $descriptionProperty = New-Object $propertyDataType diff --git a/ReportingServicesTools/Functions/CatalogItems/Write-RsCatalogItem.ps1 b/ReportingServicesTools/Functions/CatalogItems/Write-RsCatalogItem.ps1 index 667c5c0f..5eb47750 100644 --- a/ReportingServicesTools/Functions/CatalogItems/Write-RsCatalogItem.ps1 +++ b/ReportingServicesTools/Functions/CatalogItems/Write-RsCatalogItem.ps1 @@ -223,7 +223,7 @@ function Write-RsCatalogItem #region Upload other stuff else { - $additionalProperties = New-Object System.Collections.Generic.List[$propertyDataType] + $additionalProperties = New-Object System.Collections.Generic.List["$propertyDataType"] $property = New-Object $propertyDataType if ($itemType -eq 'Resource') diff --git a/ReportingServicesTools/Functions/Common/ConnectionObjectRequests.ps1 b/ReportingServicesTools/Functions/Common/ConnectionObjectRequests.ps1 index 5224eb3c..89f55b38 100644 --- a/ReportingServicesTools/Functions/Common/ConnectionObjectRequests.ps1 +++ b/ReportingServicesTools/Functions/Common/ConnectionObjectRequests.ps1 @@ -43,7 +43,7 @@ { if ($goodKeys -contains $key) { - $NewRsWebServiceProxyParam[$key] = $BoundParameters[$key] + $NewRsWebServiceProxyParam["$key"] = $BoundParameters["$key"] } } @@ -96,7 +96,7 @@ function New-RsRestSessionHelper { if ($goodKeys -contains $key) { - $NewRsRestSessionParams[$key] = $BoundParameters[$key] + $NewRsRestSessionParams["$key"] = $BoundParameters["$key"] } } @@ -184,7 +184,7 @@ function New-RsConfigurationSettingObjectHelper { if ($goodKeys -contains $key) { - $NewRsConfigurationSettingObjectParam[$key] = $BoundParameters[$key] + $NewRsConfigurationSettingObjectParam["$key"] = $BoundParameters["$key"] } } From 44b634b1ef38bf05c65ee30b6ea56cb43009557d Mon Sep 17 00:00:00 2001 From: McKie Date: Fri, 26 Jul 2019 08:33:53 +0800 Subject: [PATCH 2/4] Add in Octopus Deploy Export --- .gitignore | 1 + ReportingServicesTools/ReportingServicesTools.odsm.ps1 | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 .gitignore create mode 100644 ReportingServicesTools/ReportingServicesTools.odsm.ps1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..559be7b3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +ReportingServicesTools.Designer.ps1 \ No newline at end of file diff --git a/ReportingServicesTools/ReportingServicesTools.odsm.ps1 b/ReportingServicesTools/ReportingServicesTools.odsm.ps1 new file mode 100644 index 00000000..b308dedc --- /dev/null +++ b/ReportingServicesTools/ReportingServicesTools.odsm.ps1 @@ -0,0 +1,9 @@ +# Octopus deploy module export +$mainScript = "$PSScriptRoot\ReportingServicesTools.Designer.ps1" +@('# AUTO GENERATED SCRIPT') | sc -path $mainScript +gc "$PSScriptRoot\Libraries\library.ps1" | ac -path $mainScript + +$mainScript + +$scripts = Get-ChildItem "$PSScriptRoot\Functions" -Recurse -Include *.ps1 +foreach ($script in $scripts) { gc $script | ac -path $mainScript } \ No newline at end of file From 615092aaec66dc3b4b488cc420687a4eb8e58986 Mon Sep 17 00:00:00 2001 From: McKie Date: Fri, 26 Jul 2019 08:43:22 +0800 Subject: [PATCH 3/4] Add in source --- ReportingServicesTools/ReportingServicesTools.odsm.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReportingServicesTools/ReportingServicesTools.odsm.ps1 b/ReportingServicesTools/ReportingServicesTools.odsm.ps1 index b308dedc..284eb48e 100644 --- a/ReportingServicesTools/ReportingServicesTools.odsm.ps1 +++ b/ReportingServicesTools/ReportingServicesTools.odsm.ps1 @@ -1,6 +1,6 @@ # Octopus deploy module export $mainScript = "$PSScriptRoot\ReportingServicesTools.Designer.ps1" -@('# AUTO GENERATED SCRIPT') | sc -path $mainScript +@('# AUTO GENERATED SCRIPT', '# SOURCE https://github.com/microsoft/ReportingServicesTools') | sc -path $mainScript gc "$PSScriptRoot\Libraries\library.ps1" | ac -path $mainScript $mainScript From 37768ce8259ac91eee00f51eaf0befa509a2056e Mon Sep 17 00:00:00 2001 From: McKie Date: Fri, 26 Jul 2019 09:18:38 +0800 Subject: [PATCH 4/4] Set the encoding default for the export --- ReportingServicesTools/ReportingServicesTools.odsm.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReportingServicesTools/ReportingServicesTools.odsm.ps1 b/ReportingServicesTools/ReportingServicesTools.odsm.ps1 index 284eb48e..660f69b8 100644 --- a/ReportingServicesTools/ReportingServicesTools.odsm.ps1 +++ b/ReportingServicesTools/ReportingServicesTools.odsm.ps1 @@ -1,9 +1,9 @@ # Octopus deploy module export $mainScript = "$PSScriptRoot\ReportingServicesTools.Designer.ps1" @('# AUTO GENERATED SCRIPT', '# SOURCE https://github.com/microsoft/ReportingServicesTools') | sc -path $mainScript -gc "$PSScriptRoot\Libraries\library.ps1" | ac -path $mainScript +gc "$PSScriptRoot\Libraries\library.ps1" | ac -path $mainScript -Encoding UTF8 $mainScript $scripts = Get-ChildItem "$PSScriptRoot\Functions" -Recurse -Include *.ps1 -foreach ($script in $scripts) { gc $script | ac -path $mainScript } \ No newline at end of file +foreach ($script in $scripts) { gc $script | ac -path $mainScript -Encoding UTF8 } \ No newline at end of file