yes sir and there are two ways of deployments
1.deploy dtsx file using dtsx utility its one line script in powershell
2.my company is not using 1. then there is ssismanifest file that will deployed through deploy-er and need to open the wizard
actually I want to deploy it without opening ssis deployment wizard but there is no any script available in power shell which will deploy ssismanifest file and not dtsx
my script looks like below code but on last moment one problem occurs, wizard is not opening in one time, code is correct but when I ran same script twice or thrice then only wizard open
why it take 2-3 attempt that is now problem and 2 files are required for this script dtsConfig, dtsx, ssismanifest files
#oneClick_SSIS_Deployment on STAGE
$rootpath = "D:\SSIS_Package_Deployments\"
$repository = "D:\SSIS_Package_Dependencies\"
$d = read-host "Get SSIS Package name, without any space at END and at START"
$con = "SSIS name is confirm ?"
$e = [Windows.Forms.MessageBox]::Show($con+$d, "PowerShell rocks", [Windows.Forms.MessageBoxButtons]::YesNo, [Windows.Forms.MessageBoxIcon]::Question)
$m = "\"
$extractPath = "C:\temp\"
$FdtsConfig = ".dtsConfig"
$allFiles="\"+"Deployment_$((get-date).toString('yyyyMMdd'))"
$NewPath = $rootpath+$e+$allFiles
try{
if(-not(Test-Path -path $rootpath$e)){
#write-Host yes
$ssisdir = New-Item $rootpath$e -type directory
$deployment = New-Item $rootpath$e$m"Deployment_$((get-date).toString('yyyyMMdd'))" -type directory
$repository= New-Item $repository$e$m"PackageDependencies_$((get-date).toString('yyyyMMdd'))" -type directory
$GetZipFile = Get-ChildItem $extractPath\*.* -include *.zip
Extract-Zip $GetZipFile $extractPath
$OldPath = Get-ChildItem -Path "c:\temp\STA\" -rec
If (Test-Path $NewPath){
ForEach ($Item in $OldPath){
If ($Item.Name -match $FdtsConfig){
ls C:\temp\STA\*.dtsConfig | foreach {
$file = $_.FullName;
$xml = [xml](Get-Content $file)
$todayStr = [datetime]::Today.ToString('_yyyyMMdd')
@($xml.SelectNodes('//ConfiguredValue')) | %{ $_.'#text'=($_.'#text' -replace '_\d+',$todayStr) }
$xml.Save($file)
}
Move-Item $Item.FullName $NewPath -Force
Move-Item $extractPath\*.dtsx $NewPath -Force
Move-Item $extractPath\*.SSISDeploymentManifest $NewPath -Force
Write-Host $Item.Name
}
#start SSIS deployment wizard
Start-Sleep -s 300
$controlFileArray = Get-ChildItem $extractPath\*.SSISDeploymentManifest
& $controlFileArray
#end deploy SSIS
}
}
else{write-host 1}
}
else{
#write-Host no
$deployment = New-Item $rootpath$e$m"Deployment_$((get-date).toString('yyyyMMdd'))" -type directory
$repository= New-Item $repository$e$m"PackageDependencies_$((get-date).toString('yyyyMMdd'))" -type directory
$GetZipFile = Get-ChildItem $extractPath\*.* -include *.zip
Extract-Zip $GetZipFile $extractPath
$OldPath = Get-ChildItem -Path "c:\temp\STA\" -rec
If (Test-Path $NewPath){
ForEach ($Item in $OldPath){
If ($Item.Name -match $FdtsConfig){
ls C:\temp\STA\*.dtsConfig | foreach {
$file = $_.FullName;
$xml = [xml](Get-Content $file)
$todayStr = [datetime]::Today.ToString('_yyyyMMdd')
@($xml.SelectNodes('//ConfiguredValue')) | %{ $_.'#text'=($_.'#text' -replace '_\d+',$todayStr) }
$xml.Save($file)
}
Move-Item $Item.FullName $NewPath -Force
Move-Item $extractPath\*.dtsx $NewPath -Force
Move-Item $extractPath\*.SSISDeploymentManifest $NewPath -Force
Write-Host $Item.Name
}
#start SSIS deployment wizard
Start-Sleep -s 300
$controlFileArray = Get-ChildItem $extractPath\*.SSISDeploymentManifest
& $controlFileArray
#end deploy SSIS
}
}
else{write-host 2}
}
}
Catch [System.Management.Automation.ItemNotFoundException] {"Check folders structure D:\SSIS_Package_Deployments\, D:\SSIS_Package_Dependencies "}
function Extract-Zip{
param([string]$zipfilename, [string] $destination)
$shellApplication = new-object -com shell.application
$zipPackage = $shellApplication.NameSpace($zipfilename)
$destinationFolder = $shellApplication.NameSpace("C:\temp")
$myfile = $destinationFolder.CopyHere($zipPackage.Items())
}
still wizard is not opening in one shot after #start ssis deployment wizard line