<?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 Executing a powershell script from SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Executing-a-powershell-script-from-SAS/m-p/263983#M51715</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to find the best solution for executing a powershell script from a sas program.&amp;nbsp; I have found a few articles that discuss pulling information into SAS EG with powershell or calling SAS EG jobs using powershell but I have not seen anything that will show me how to execute a powershell command to run a script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;</description>
    <pubDate>Thu, 14 Apr 2016 19:22:11 GMT</pubDate>
    <dc:creator>elwayfan446</dc:creator>
    <dc:date>2016-04-14T19:22:11Z</dc:date>
    <item>
      <title>Executing a powershell script from SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Executing-a-powershell-script-from-SAS/m-p/263983#M51715</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to find the best solution for executing a powershell script from a sas program.&amp;nbsp; I have found a few articles that discuss pulling information into SAS EG with powershell or calling SAS EG jobs using powershell but I have not seen anything that will show me how to execute a powershell command to run a script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 19:22:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Executing-a-powershell-script-from-SAS/m-p/263983#M51715</guid>
      <dc:creator>elwayfan446</dc:creator>
      <dc:date>2016-04-14T19:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Executing a powershell script from SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Executing-a-powershell-script-from-SAS/m-p/264002#M51719</link>
      <description>&lt;P&gt;Ok, I figured it out by pieceing some articles I found together.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Within a SAS program, insert the following code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let machine = pp7h56j082; /* Machine name with admin privledges */
x 'C:\Windows\syswow64\Windowspowershell\v1.0\powershell.exe' -file "L:\Powershell Files\PrintFromExcelToPDF.ps1" &amp;amp;machine;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The Macro sets the machine name that has administrator permissions in order to call the powershell commands in the .ps1 file.&amp;nbsp; The remaining code opens powershell via windows command and passes in the powershell command to execute the powershell script needed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps others!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 14:03:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Executing-a-powershell-script-from-SAS/m-p/264002#M51719</guid>
      <dc:creator>elwayfan446</dc:creator>
      <dc:date>2016-04-15T14:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: Executing a powershell script from SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Executing-a-powershell-script-from-SAS/m-p/264083#M51754</link>
      <description>&lt;P&gt;Your code is not syntactically correct.&lt;/P&gt;
&lt;P&gt;- there is a missing single quote to close the command string&lt;/P&gt;
&lt;P&gt;- single quotes prevent the resolution of the macro variable&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 05:40:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Executing-a-powershell-script-from-SAS/m-p/264083#M51754</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-04-15T05:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Executing a powershell script from SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Executing-a-powershell-script-from-SAS/m-p/264175#M51782</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser﻿&lt;/a&gt;.&amp;nbsp; It was a typo in my code but it seemed to work anyway.&amp;nbsp; I have corrected the code and the post above.&amp;nbsp; I appreciate the heads up!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 14:03:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Executing-a-powershell-script-from-SAS/m-p/264175#M51782</guid>
      <dc:creator>elwayfan446</dc:creator>
      <dc:date>2016-04-15T14:03:49Z</dc:date>
    </item>
  </channel>
</rss>

