From 1efe1f73ebae6d24bbf7c0c785b95ce148b42975 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Mon, 17 Jul 2023 11:25:30 +0200 Subject: [PATCH] Update check-vpn.ps1 --- Scripts/check-vpn.ps1 | 10 +++++----- Scripts/write-lowercase.ps1 | 7 ++++--- Scripts/write-uppercase.ps1 | 7 ++++--- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Scripts/check-vpn.ps1 b/Scripts/check-vpn.ps1 index 6e98b1b4..c676a5a7 100755 --- a/Scripts/check-vpn.ps1 +++ b/Scripts/check-vpn.ps1 @@ -2,10 +2,10 @@ .SYNOPSIS Checks the VPN status .DESCRIPTION - This PowerShell script queries the status of the VPN connection(s) and prints it. + This PowerShell script queries and prints the status of the VPN connection(s). .EXAMPLE - PS> ./check-vpn - ✅ VPN to NASA L2TP: Disconnected + PS> ./check-vpn.ps1 + ✅ VPN to NASA L2TP is disconnected .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -19,11 +19,11 @@ try { } else { $Connections = Get-VPNConnection foreach($Connection in $Connections) { - "✅ VPN to $($Connection.Name): $($Connection.ConnectionStatus)" + Write-Host "✅ VPN to $($Connection.Name) is $($Connection.ConnectionStatus.ToLower())" $NoVPN = $false } } - if ($NoVPN) { "⚠️ No VPN" } + if ($NoVPN) { Write-Host "⚠️ No VPN" } exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" diff --git a/Scripts/write-lowercase.ps1 b/Scripts/write-lowercase.ps1 index a61c9157..a5f0e47a 100755 --- a/Scripts/write-lowercase.ps1 +++ b/Scripts/write-lowercase.ps1 @@ -2,11 +2,12 @@ .SYNOPSIS Writes text in lowercase letters .DESCRIPTION - This PowerShell script writes text in lowercase letters. + This PowerShell script writes the given text in lowercase letters. .PARAMETER text Specifies the text to write .EXAMPLE PS> ./write-lowercase "Hello World" + hello world .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -15,7 +16,7 @@ param([string]$text = "") -if ($text -eq "" ) { $text = read-host "Enter the text to write" } +if ($text -eq "" ) { $text = Read-Host "Enter the text to write" } -write-output $text.ToLower() +Write-Output $text.ToLower() exit 0 # success diff --git a/Scripts/write-uppercase.ps1 b/Scripts/write-uppercase.ps1 index e8289365..2108604f 100755 --- a/Scripts/write-uppercase.ps1 +++ b/Scripts/write-uppercase.ps1 @@ -2,11 +2,12 @@ .SYNOPSIS Writes text in uppercase letters .DESCRIPTION - This PowerShell script writes text in uppercase letters. + This PowerShell script writes the given text in uppercase letters. .PARAMETER text Specifies the text to write .EXAMPLE PS> ./write-uppercase "Hello World" + HELLO WORLD .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -15,7 +16,7 @@ param([string]$text = "") -if ($text -eq "" ) { $text = read-host "Enter the text to write" } +if ($text -eq "" ) { $text = Read-Host "Enter the text to write" } -write-output $text.ToUpper() +Write-Output $text.ToUpper() exit 0 # success