Hi all I am trying to deploy SSRS using PowerShell as follows which is creating the report but not the datasource.
I tried the approach from here but not working as expected
https://blogs.infosupport.com/managing-ssrs-reports-with-powershell/#comment-124935
http://hindenes.com/powershell/SQLReporting.psm1
$ssrsproxy = New-WebServiceProxy -Uri $webServiceUrl -UseDefaultCredential -Namespace "SSRS"
- $proxyNameSpace = $ssrsproxy.gettype().Namespace
- $datasourceDef = New-Object("$proxyNameSpace.DataSourceDefinition")
- $datasourceDef.connectstring = $connectString
- $datasourcedef.Extension = $Extension
- $datasourceDef.Enabled = $true
- $datasourceDef.EnabledSpecified = $true
- $datasourceDef.ImpersonateUserSpecified = $false
- $datasourceDef.Prompt = $null
- $datasourceDef.WindowsCredentials = $false
- try
- {
- $ssrsproxy.CreateDataSource($DataSourceName, $path, $true, $datasourceDef, $null)
- }
- catch
- {
- "Error was $_"
- $line = $_.InvocationInfo.ScriptLineNumber
- "Error was in Line $line"
- }
Error was Cannot convert argument "Definition", with value: "SSRS.DataSourceDefinition", for "CreateDataSource" to type "SSRS.DataSourceDefinition ": "Cannot convert the "SSRS.DataSourceDefinition" value of type "SSRS.DataSourceDefinition" to type "SSRS.DataSourceDefinition"." Error was in Line 47

Answers
Know the answer? Post it. Somebody with the same question will find it here.