forked from GithubBackups/healthchecks
Updated PowerShell example.
This commit is contained in:
parent
0f7a1ec60e
commit
148e85783c
@ -35,6 +35,7 @@ class Command(BaseCommand):
|
||||
_process("python_requests", lexers.PythonLexer())
|
||||
_process("php", lexers.PhpLexer())
|
||||
_process("powershell", lexers.shell.PowerShellLexer())
|
||||
_process("powershell_inline", lexers.shell.BashLexer())
|
||||
_process("node", lexers.JavascriptLexer())
|
||||
|
||||
# API examples
|
||||
|
@ -157,6 +157,11 @@ the following command in a Scheduled Task to run the script:
|
||||
<pre>powershell.exe -ExecutionPolicy bypass -File C:\Scripts\healthchecks.ps1</pre>
|
||||
</div>
|
||||
|
||||
<p>In simple cases, you can also pass the script to PowerShell directly,
|
||||
using the "-command" argument:</p>
|
||||
|
||||
{% include "front/snippets/powershell_inline.html" %}
|
||||
|
||||
<a name="email"></a>
|
||||
<h3>Email</h3>
|
||||
<p>
|
||||
|
@ -1,3 +1,3 @@
|
||||
<div class="highlight"><pre><span></span><span class="c1"># m h dom mon dow command</span>
|
||||
<span class="m">8</span> <span class="m">6</span> * * * /home/user/backup.sh <span class="o">&&</span> curl -fsS --retry <span class="m">3</span> {{ ping_url }} > /dev/null
|
||||
<div class="highlight"><pre><span></span><span class="c1"># m h dom mon dow command</span>
|
||||
<span class="m">8</span> <span class="m">6</span> * * * /home/user/backup.sh <span class="o">&&</span> curl -fsS --retry <span class="m">3</span> {{ ping_url }} > /dev/null
|
||||
</pre></div>
|
||||
|
@ -1,2 +1,3 @@
|
||||
<div class="highlight"><pre><span></span><span class="nb">Invoke-RestMethod</span> <span class="n">{{ ping_url }}</span>
|
||||
<div class="highlight"><pre><span></span><span class="c"># inside a PowerShell script:</span>
|
||||
<span class="nb">Invoke-RestMethod</span> <span class="n">{{ ping_url }}</span>
|
||||
</pre></div>
|
||||
|
@ -1 +1,2 @@
|
||||
# inside a PowerShell script:
|
||||
Invoke-RestMethod PING_URL
|
3
templates/front/snippets/powershell_inline.html
Normal file
3
templates/front/snippets/powershell_inline.html
Normal file
@ -0,0 +1,3 @@
|
||||
<div class="highlight"><pre><span></span><span class="c1"># Without an underlying script, passing the command to PowerShell directly:</span>
|
||||
powershell.exe -command <span class="p">&</span><span class="o">{</span>Invoke-RestMethod {{ ping_url }}<span class="o">}</span>
|
||||
</pre></div>
|
2
templates/front/snippets/powershell_inline.txt
Normal file
2
templates/front/snippets/powershell_inline.txt
Normal file
@ -0,0 +1,2 @@
|
||||
# Without an underlying script, passing the command to PowerShell directly:
|
||||
powershell.exe -command &{Invoke-RestMethod PING_URL}
|
@ -80,6 +80,7 @@
|
||||
</div>
|
||||
<div class="tab-pane" id="powershell">
|
||||
{% include "front/snippets/powershell.html" %}
|
||||
{% include "front/snippets/powershell_inline.html" %}
|
||||
</div>
|
||||
<div class="tab-pane tab-pane-email" id="email">
|
||||
<p>
|
||||
|
Loading…
x
Reference in New Issue
Block a user