Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
keerthika
Creator II
Creator II

How to call power shell script in Qlikview

Hi,

    My code is executing in powershell but how to call that script stored in txt file from qlikview, i have encrypted the password here

$Username = "test"

$Password = "D:\test\EmailPassword.txt"

$MyCredential=New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Username, (Get-Content $Password | ConvertTo-SecureString)

$From = "test@gmail.com"

$To = "test@gmail.com"

$Subject = "Here's the Email Subject"

$Body = "This is what I want to say"

$SMTPServer = "smtp.gmail.com"

$SMTPPort = "587"

Send-MailMessage -From $From -to $To -Subject $Subject -Body $Body -SmtpServer $SMTPServer -port $SMTPPort -UseSsl -Credential ($MyCredential) –DeliveryNotificationOption OnSuccess

Thanks in advance,

keke

2 Replies
tresesco
MVP
MVP

Try using qlik's Execute command. Have a look here too: QlikView and Windows PowerShell

keerthika
Creator II
Creator II
Author

Hi,

I used below command to run powershell script in qlikview. but is shows some error .

  Execute cmd /C powershell -command  c:\temp\enviar_email_correto.ps1;



Thanks,

Keke