I am trying to pass a SSIS variable into a PowerShell script that is running via a Process Task within SSIS, im using SSIS 2008 if that makes any difference
Here is a copy of the powershell script im using that runs fine when executed with hardcoded values
param ([string]$SourceServer, [string]$DestinationServer, [string]$Filename )
$SourceServer = "SERVERA"
$DestinationServer = "SERVERB"
$Filename = "DbNAME.mdf"
$SourcePath = "\D$\Data\"
$DestinationPath = "\D$\Data\Backups\"
$Source = '\\' + $SourceServer + $SourcePath + $Filename
$Destination = '\\' + $DestinationServer + $DestinationPath + $Filename
copy-item -path $Source -destination $Destination -verbose
I can get the PowerShell script to run fine if I hardcode the param's , however as soon as I change it to a variable the variable value isn't being passed through
Within the process task this is the executable
"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
The arguments string is being built correctly so I know the variable value is being passed in
-ExecutionPolicy Unrestricted -File "C:\Qarefresh.ps1" "DbaseA.mdf"
And here is the code for the expression
"-ExecutionPolicy Unrestricted -File \"" + "C:\\Qarefresh.ps1\" \"" + @[User::QA_FileName] + "\""
I'm relatively new to PowerShell so apologise if I have missed something basic , but i'm close to pulling out my hair with this one
Thanks in advance for any help given








