Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
67 lines (50 sloc) 1.53 KB
using namespace System.Net
# Input bindings are passed in via param block.
param($Request, $TriggerMetadata)
# Write to the Azure Functions log stream.
Write-Host "PowerShell HTTP trigger function processed a request."
$VM = Get-AzVM -Status -Name "pfsense"
$HTML = New-Object -TypeName "System.Text.StringBuilder"
[void]$HTML.AppendLine( @"
<!DOCTYPE html>
<title> VM starter</title>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
<h1> <br />
SelfService VPN starter</h1>
<b>Current state of the VPN machine:</b><br/>
<th>VMname</th><th>Current Powerstate</th>
<H2>Press the button to start the VPN server, if not running</H2>
<p>After pressing the button, it can take up to 10 minutes for the server to start</p>
<form action="" method="post">
<input type="submit" name="Start" value="Start VPN server" />
<br />
<p>To download the VPN client, click the link below:</p>
<a href="https://********" target="_blank" rel="Download VPN client">Download</a>
# Associate values to output bindings by calling 'Push-OutputBinding'.
Push-OutputBinding -Name Response -Value (@{
StatusCode = "Ok"
ContentType = "text/html"
Body = $HTML.ToString()
You can’t perform that action at this time.