- $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