Increase compatibility

This commit is contained in:
Adrien Ferrand 2019-12-11 23:57:37 +01:00
parent 1b16d64b9f
commit 2a9505927a
3 changed files with 2 additions and 5 deletions

View file

@ -1,8 +1,8 @@
#Requires -RunAsAdministrator
[CmdletBinding()]
param()
begin {}
process {
New-Item "C:\Certbot\log" -ItemType Directory -ErrorAction SilentlyContinue *>$Null
Start-Transcript -Path "C:\Certbot\log\auto-update.log"
trap { Stop-Transcript }
@ -25,6 +25,7 @@ process {
# Get latest remote certbot version
try {
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$result = Invoke-RestMethod -Uri https://api.github.com/repos/certbot/certbot/releases/latest
$latestVersion = $result.tag_name -replace '^v(\d+\.\d+\.\d+).*$', '$1'
$latestVersion = [System.Version]"$latestVersion"

View file

@ -1,5 +1,3 @@
#Requires -RunAsAdministrator
$tasks = "Certbot Renew & Auto-Update Task", "Certbot Renew Task"
foreach ($task in $tasks) {

View file

@ -1,5 +1,3 @@
#Requires -RunAsAdministrator
param(
[Parameter(Mandatory=$true, ValueFromPipeline=$true)]
[string]