0
我正在嘗試編寫一個Powershell腳本來重新部署項目到SSIS並且不會毀壞目錄我只是想刪除包含該項目的文件夾。使用Powershell刪除SSISDB目錄中的SSIS文件夾
下面是對FolderToDrop調用Drop()
代碼:時引發
$integrationServices = New-Object $Namespace".IntegrationServices" $sqlConnection
$catalog = $integrationServices.Catalogs["SSISDB"]
if ($catalog.Folders.Contains("FolderToDrop")) {
$catalog.Folders["FolderToDrop"].Drop()
}
例外:
Exception calling "Drop" with "0" argument(s): "Operation 'Drop' on object 'CatalogFolder[@Name='FolderToDrop']' failed during execution."
At C:\Projects\Scripts\Deploy.ps1:36 char:29
+ $catalog.Folders["FolderToDrop"].Drop <<<<()
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
任何想法,以什麼我缺少努力刪除這個文件夾?