<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to Run Power shell script in Qlik Sense in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-to-Run-Power-shell-script-in-Qlik-Sense/m-p/1937123#M77236</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;All these points are ok:&lt;BR /&gt;- execution of the script with the QS service account&lt;BR /&gt;- Excel on the QS server&lt;BR /&gt;- Single node configuration&lt;/P&gt;
&lt;P&gt;I also tested the execution of the script on my computer, via QS Desktop, and it's ok.&lt;/P&gt;
&lt;P&gt;When I run the script below via external tasks, the txt file is created, but not the Excel file.&lt;BR /&gt;Sorry but I am not comfortable with the powershell scripting, where can I add the instructions to log?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot!&lt;/P&gt;
&lt;P&gt;#Define locations and delimiter&lt;BR /&gt;$csv = "C:\_Consultants\ARY\PS1\conversionexcel.csv" #Location of the source file&lt;BR /&gt;$xlsx = "C:\_Consultants\ARY\PS1\conversionexcel.xlsx" #Desired location of output&lt;BR /&gt;$delimiter = ";" #Specify the delimiter used in the file&lt;/P&gt;
&lt;P&gt;# Create a new Excel workbook with one empty sheet&lt;BR /&gt;$excel = New-Object -ComObject excel.application&lt;BR /&gt;$workbook = $excel.Workbooks.Add(1)&lt;BR /&gt;$worksheet = $workbook.worksheets.Item(1)&lt;/P&gt;
&lt;P&gt;# Build the QueryTables.Add command and reformat the data&lt;BR /&gt;$TxtConnector = ("TEXT;" + $csv)&lt;BR /&gt;$Connector = $worksheet.QueryTables.add($TxtConnector,$worksheet.Range("A1"))&lt;BR /&gt;$query = $worksheet.QueryTables.item($Connector.name)&lt;BR /&gt;$query.TextFileOtherDelimiter = $delimiter&lt;BR /&gt;$query.TextFileParseType = 1&lt;BR /&gt;$query.TextFileColumnDataTypes = ,1 * $worksheet.Cells.Columns.Count&lt;BR /&gt;$query.AdjustColumnWidth = 1&lt;/P&gt;
&lt;P&gt;# Execute &amp;amp; delete the import query&lt;BR /&gt;$query.Refresh()&lt;BR /&gt;$query.Delete()&lt;/P&gt;
&lt;P&gt;# Save &amp;amp; close the Workbook as XLSX.&lt;BR /&gt;$workbook.SaveAs($xlsx,51)&lt;BR /&gt;$excel.Quit()&lt;BR /&gt;&lt;BR /&gt;Out-File -FilePath "C:\_Consultants\ARY\PS1\test.txt"&lt;/P&gt;</description>
    <pubDate>Mon, 30 May 2022 08:59:35 GMT</pubDate>
    <dc:creator>arychener</dc:creator>
    <dc:date>2022-05-30T08:59:35Z</dc:date>
    <item>
      <title>How to Run Power shell script in Qlik Sense</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-Run-Power-shell-script-in-Qlik-Sense/m-p/1650660#M48552</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; I have power shell script file(.ps1). I need to run the file from Qlik Sense . I tried with Batch file. While Running the batch file manually i am getting the expected result. When i am running the batch with Execute command it is not working as expected. But script load completed without any error&lt;/P&gt;&lt;P&gt;Note : My power shell script converts different excels into single excel in different sheets&lt;/P&gt;&lt;P&gt;I ll appreciate the immediate reply.&lt;/P&gt;&lt;P&gt;Thank and Regards,&lt;/P&gt;&lt;P&gt;Dineshraj R&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2019 13:10:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-Run-Power-shell-script-in-Qlik-Sense/m-p/1650660#M48552</guid>
      <dc:creator>dineshraj</dc:creator>
      <dc:date>2019-11-25T13:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to Run Power shell script in Qlik Sense</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-Run-Power-shell-script-in-Qlik-Sense/m-p/1650683#M48555</link>
      <description>&lt;P&gt;This could be privilege issue. Check here:&amp;nbsp;&lt;A href="https://community.qlik.com/t5/QlikView-Documents/QlikView-and-Windows-PowerShell/ta-p/1497315" target="_blank"&gt;https://community.qlik.com/t5/QlikView-Documents/QlikView-and-Windows-PowerShell/ta-p/1497315&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2019 13:41:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-Run-Power-shell-script-in-Qlik-Sense/m-p/1650683#M48555</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2019-11-25T13:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to Run Power shell script in Qlik Sense</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-Run-Power-shell-script-in-Qlik-Sense/m-p/1650726#M48565</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have seen this already. It didn't help me. Is there any other way to run the (.ps1) file?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2019 14:46:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-Run-Power-shell-script-in-Qlik-Sense/m-p/1650726#M48565</guid>
      <dc:creator>dineshraj</dc:creator>
      <dc:date>2019-11-25T14:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to Run Power shell script in Qlik Sense</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-Run-Power-shell-script-in-Qlik-Sense/m-p/1935613#M77089</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/10561"&gt;@dineshraj&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I've the same issue.. did you find a solution ?&lt;/P&gt;
&lt;P&gt;Thanks !&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 14:54:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-Run-Power-shell-script-in-Qlik-Sense/m-p/1935613#M77089</guid>
      <dc:creator>arychener</dc:creator>
      <dc:date>2022-05-25T14:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to Run Power shell script in Qlik Sense</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-Run-Power-shell-script-in-Qlik-Sense/m-p/1935662#M77092</link>
      <description>&lt;P&gt;Have you ensured that the Qlik Sense environment is running 'Legacy Mode' and '&lt;SPAN&gt;OverrideScriptSecurity' has been enabled?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Please see this article on the 'EXECUTE' function:&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/sense/February2022/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptRegularStatements/Execute.htm" target="_blank" rel="noopener"&gt;https://help.qlik.com/en-US/sense/February2022/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptRegularStatements/Execute.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;How to disable Standard Mode:&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/sense/May2022/Subsystems/Hub/Content/Sense_Hub/LoadData/disable-standard-mode.htm" target="_blank"&gt;https://help.qlik.com/en-US/sense/May2022/Subsystems/Hub/Content/Sense_Hub/LoadData/disable-standard-mode.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Note: This does expose the File System of the Qlik Sense environment&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 16:09:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-Run-Power-shell-script-in-Qlik-Sense/m-p/1935662#M77092</guid>
      <dc:creator>Qlik_Eric_Thomas</dc:creator>
      <dc:date>2022-05-25T16:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to Run Power shell script in Qlik Sense</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-Run-Power-shell-script-in-Qlik-Sense/m-p/1935684#M77097</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Yes I'm in legacy mode, and I'm already using the Execute command for another ps1 without any problems. It seems that it is the ps1 that uses Excel (well installed on the Qlik Sense server) that is not working.&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 16:51:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-Run-Power-shell-script-in-Qlik-Sense/m-p/1935684#M77097</guid>
      <dc:creator>arychener</dc:creator>
      <dc:date>2022-05-25T16:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to Run Power shell script in Qlik Sense</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-Run-Power-shell-script-in-Qlik-Sense/m-p/1935774#M77106</link>
      <description>&lt;P&gt;It's hard to say why including excel functionality in your powershell script&amp;nbsp; causes different behaviour. I would suggest attempting to run this powershell script as the Qlik Sense service account on the Qlik Sense server.&lt;/P&gt;&lt;P&gt;If you are dealing with multiple nodes, there are additional considerations such as making sure the file location is accessible from any server that may perform the reload (I would suggest using UNC paths or even Folder Data Connections). Also make sure Excel is on any server that may perform the reload.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could be useful to log powershell error during execution with something like&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;*&amp;gt;&amp;amp;1 &amp;gt; output.txt&lt;/LI-CODE&gt;&lt;P&gt;at the end of the script&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 21:17:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-Run-Power-shell-script-in-Qlik-Sense/m-p/1935774#M77106</guid>
      <dc:creator>Qlik_Eric_Thomas</dc:creator>
      <dc:date>2022-05-25T21:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to Run Power shell script in Qlik Sense</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-Run-Power-shell-script-in-Qlik-Sense/m-p/1937123#M77236</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;All these points are ok:&lt;BR /&gt;- execution of the script with the QS service account&lt;BR /&gt;- Excel on the QS server&lt;BR /&gt;- Single node configuration&lt;/P&gt;
&lt;P&gt;I also tested the execution of the script on my computer, via QS Desktop, and it's ok.&lt;/P&gt;
&lt;P&gt;When I run the script below via external tasks, the txt file is created, but not the Excel file.&lt;BR /&gt;Sorry but I am not comfortable with the powershell scripting, where can I add the instructions to log?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot!&lt;/P&gt;
&lt;P&gt;#Define locations and delimiter&lt;BR /&gt;$csv = "C:\_Consultants\ARY\PS1\conversionexcel.csv" #Location of the source file&lt;BR /&gt;$xlsx = "C:\_Consultants\ARY\PS1\conversionexcel.xlsx" #Desired location of output&lt;BR /&gt;$delimiter = ";" #Specify the delimiter used in the file&lt;/P&gt;
&lt;P&gt;# Create a new Excel workbook with one empty sheet&lt;BR /&gt;$excel = New-Object -ComObject excel.application&lt;BR /&gt;$workbook = $excel.Workbooks.Add(1)&lt;BR /&gt;$worksheet = $workbook.worksheets.Item(1)&lt;/P&gt;
&lt;P&gt;# Build the QueryTables.Add command and reformat the data&lt;BR /&gt;$TxtConnector = ("TEXT;" + $csv)&lt;BR /&gt;$Connector = $worksheet.QueryTables.add($TxtConnector,$worksheet.Range("A1"))&lt;BR /&gt;$query = $worksheet.QueryTables.item($Connector.name)&lt;BR /&gt;$query.TextFileOtherDelimiter = $delimiter&lt;BR /&gt;$query.TextFileParseType = 1&lt;BR /&gt;$query.TextFileColumnDataTypes = ,1 * $worksheet.Cells.Columns.Count&lt;BR /&gt;$query.AdjustColumnWidth = 1&lt;/P&gt;
&lt;P&gt;# Execute &amp;amp; delete the import query&lt;BR /&gt;$query.Refresh()&lt;BR /&gt;$query.Delete()&lt;/P&gt;
&lt;P&gt;# Save &amp;amp; close the Workbook as XLSX.&lt;BR /&gt;$workbook.SaveAs($xlsx,51)&lt;BR /&gt;$excel.Quit()&lt;BR /&gt;&lt;BR /&gt;Out-File -FilePath "C:\_Consultants\ARY\PS1\test.txt"&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 08:59:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-Run-Power-shell-script-in-Qlik-Sense/m-p/1937123#M77236</guid>
      <dc:creator>arychener</dc:creator>
      <dc:date>2022-05-30T08:59:35Z</dc:date>
    </item>
  </channel>
</rss>

