posh | Powershell‎ > ‎posh | SSIS‎ > ‎

posh.is | sqlpsx.package_processing

if((Get-Module ssis) -eq $null){Import-Module ssis -Force}

<#
Get-ISItem -path \dbsrv1 -topLevelFolder msdb -serverName . -include "OneCOATransaction" | ?{$_.flags -ne "folder"} | %{
    Copy-ISItemSQLToSQL -path \ -topLevelFolder msdb -serverName . -destination msdb\dbsrv4 -destinationServer . -include $_.name
    $_ | Remove-ISItem
}
#>
<#
Get-ISItem -path \dbsrv1 -topLevelFolder msdb -serverName . -include "OneCOATransaction" | ?{$_.flags -ne "folder"} | %{
    Copy-ISItemSQLToSQL -path \ -topLevelFolder msdb -serverName . -destination msdb\dbsrv4 -destinationServer . -include $_.name
    $_ | Remove-ISItem
}    #移動SQL內封裝至資料夾
#>

<#
Get-ISItem -path \ -topLevelFolder msdb -serverName . | ?{$_.flags -ne "folder"} | %{
    Copy-ISItemSQLToSQL -path \ -topLevelFolder msdb -serverName . -destination msdb\dbsrv6 -destinationServer . -include $_.name
    $_ | Remove-ISItem
}    #移動SQL內封裝至資料夾
#>


<#
Copy-ISItemSQLToFile -path \dbsrv1 -topLevelFolder msdb -serverName . -destination d:\ssis\dbsrv1  #複製SQL封裝到檔案系統
#>

<#
DIR "D:\Integration Services Project2\Integration Services Project2\" -Filter "IS_007_aEnrich_amm11.dtsx" | %{
    $DTSX = $_.NAME
    $_.DIRECTORYNAME
    Copy-ISItemFileToSQL -path $($_.DIRECTORYNAME + "\*") -destination "msdb\" -destinationServer . -include $_.NAME -protectionLevel EncryptSensitiveWithPassword
}

$package_now = Get-ISItem -path "\" -topLevelFolder "MSDB" -serverName . -include $($DTSX -REPLACE "\.dtsx$","")

Remove-ISItem -pInfo $package_now
#先import後移除
#>

Comments