我正在使用powershell部署我們的SSRS報告,但在部署多個報告時遇到問題。Powershell Web服務方法定義更改
$ URI = 「HTTP:///Reportserver2008/reportservice2005.asmx」
$代理=新WebServiceProxy -uri $ URI - 命名SSRS.ReportingService2005 -UseDefaultCredential;
$ Proxy | GM 「SetItemDataSources」
它返回的方法定義:如果我重複
System.Void SetItemDataSources(字符串項目,SSRS.ReportingService2005.DataSource []數據源)
代碼在上面,方法定義第二次請求變更 例如
$ uri =「http:///Reportserver2008/reportservice2005.asmx」
$ Proxy = New-WebServiceProxy -Uri $ uri -Namespace SSRS.ReportingService2005 -UseDefaultCredential;
$ Proxy | gm「SetItemDataSources」 $ Proxy = New-WebServiceProxy -Uri $ uri -Namespace SSRS.ReportingService2005 -UseDefaultCredential;
$ Proxy | GM 「SetItemDataSources」
返回兩種不同方法定義:
- System.Void SetItemDataSources(串項目,SSRS.ReportingService2005.DataSource []數據源)
- System.Void SetItemDataSources(串Item,SSRS.ReportingService2005.DataSource [],0juuvurk,Ve ...
任何人都可以解釋爲什麼定義更改? 我已經嘗試在第一次請求後處理$ proxy,Uri不更改
我想我可能不得不退出$ proxy並只分配一次。 任何洞察不勝感激!
感謝的是,確實有很大的幫助。解釋我遇到的其他一些問題。你知道是否有清理會議的方法嗎?我的幾個腳本隨機停止工作,通過在PowerShell中打開另一個PowerShell來解決問題,他們將在嵌套級別或重新啓動後工作。看來我需要一種保持會話整潔的方法?!?再次感謝 –
不幸的是,一旦你在.NET中加載一個類型,它永遠不能卸載。 New-WebServiceProxy正在創建新的類型,因此從來沒有「Remove-WebServiceProxy」或清理的可能性。 與許多其他應用程序範圍問題一樣,我使用Start-Job。這在另一個.EXE中創建了一個本地工作。開始作業{測試腳本} |等待工作|接收工作將讓你從一個appdomain一次又一次的測試。 –