Quantcast
Channel: SQLServerCentral » Programming » Powershell » Latest topics
Viewing all articles
Browse latest Browse all 467

Help calling PowerShell Function via SSIS EPT

$
0
0
Hi,I successfully tested this by using the following expression:"-ExecutionPolicy Unrestricted -File \"" + @[User::Script_Path] + "\\Exec PoSh Script.PS1\" \"" + @[User::FirstName] + "\" \"" + @[User::Surname] + "\""which resulted in the following Arguments:-ExecutionPolicy Unrestricted -File "C:\Users\XXX\Desktop\Exec PoSh Script.PS1" "FName" "LName"The logfile gets written to and all is fine.After testing, I attempted to actually accomplish what I needed done (zipping & pw protecting) by calling a PowerShell function developed here by Daniel (http://blog.danskingdom.com/powershell-function-to-create-a-password-protected-zip-file/)In the powershell cmd line it works perfectly when i use: .\c:\users\xxx\desktop\Write-ZipUsing7Zip.ps1; Write-ZipUsing7Zip -FilesToZip "C:\SomeFolder" -ZipOutputFilePath "C:\SomeFolder.zip" -Password "password123"When building that expression in SSIS as the Argument it does not seem to work when executing the SSIS package. Why? I think it has something to do with calling a PS Function inside the PS script.Thank you!

Viewing all articles
Browse latest Browse all 467

Trending Articles