Skip to content

Commit 3c97de2

Browse files
committed
add comments
1 parent e3c3535 commit 3c97de2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Nginx-Manager.ps1

+14
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
1+
2+
#
3+
# V1.0
4+
# Created by craeckor
5+
# Nginx-Manager
6+
# A simple Powershell Windows-Forms Nginx-Manager
7+
#
8+
9+
# Checks if nginx.exe is available. If not = error message
110
if (Test-Path ".\nginx.exe") {
211
Add-Type -AssemblyName System.Windows.Forms
312
Add-Type -AssemblyName System.Drawing
413

14+
# Import Icon from nginx.exe
515
$icon = [System.Drawing.Icon]::ExtractAssociatedIcon("nginx.exe")
616

17+
# Get current Nginx version
718
$nginxv = cmd /c nginx.exe -v 2`>`&1
819
$nginxv = $nginxv | ConvertFrom-String -Delimiter nginx | Select-Object -ExpandProperty P3
920
$nginxv = $($nginxv -replace "/", "")
@@ -20,6 +31,7 @@ if (Test-Path ".\nginx.exe") {
2031
}
2132
}
2233

34+
# Another function to check if nginx is running
2335
function CheckNginxStatus2 {
2436
$nginxStatus = Get-Process -Name nginx -ErrorAction SilentlyContinue
2537
if ($nginxStatus) {
@@ -41,11 +53,13 @@ if (Test-Path ".\nginx.exe") {
4153
}
4254
}
4355

56+
# Function to execute nginx commands, capture the information and give the information out
4457
function ExecuteNginxCommandwithCapture($command) {
4558
$nginxoutput = cmd /c nginx.exe $command 2`>`&1
4659
[System.Windows.Forms.MessageBox]::Show("$nginxoutput", "Information", "OK", "Information")
4760
}
4861

62+
# Function to start nginx
4963
function StartNginx {
5064
$isNginxrunning = CheckNginxStatus2
5165
if ($isNginxrunning) {

0 commit comments

Comments
 (0)