<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Powershell on djismgaming&#39;s tech home</title>
    <link>https://djismgaming.github.io/tags/powershell/</link>
    <description>Recent content in Powershell on djismgaming&#39;s tech home</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 29 Nov 2024 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://djismgaming.github.io/tags/powershell/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Run a PowerShell ps1 script hidden from view and scheduled on Task Scheduler for Windows</title>
      <link>https://djismgaming.github.io/blog/powershell-hidden-script-task-scheduler/</link>
      <pubDate>Fri, 29 Nov 2024 00:00:00 +0000</pubDate>
      <guid>https://djismgaming.github.io/blog/powershell-hidden-script-task-scheduler/</guid>
      <description>&lt;h2 id=&#34;the-script-launcher&#34;&gt;The script launcher&lt;/h2&gt;
&lt;p&gt;We need a script launcher as PowerShell scripts run in the foreground and we don&amp;rsquo;t want the window of this script to appear at all.&lt;/p&gt;
&lt;p&gt;This one can be a &lt;code&gt;.vbs&lt;/code&gt; file that will be setup like this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In Task Scheduler
&lt;ul&gt;
&lt;li&gt;Action: Start a program&lt;/li&gt;
&lt;li&gt;Program/script: &lt;code&gt;wscript&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Add arguments (optional): &lt;code&gt;&amp;lt;path\to\the\.ps1\file&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here is the &lt;code&gt;.vbs&lt;/code&gt; script:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-vbs&#34; data-lang=&#34;vbs&#34;&gt;command = &amp;#34;powershell.exe -ExecutionPolicy Bypass C:\Users\Ismael\Documents\GitHub\djismgaming.github.io\blogupdate.ps1&amp;#34;

set shell = CreateObject(&amp;#34;WScript.Shell&amp;#34;)

shell.Run command, 0
&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
  </channel>
</rss>
