From baf608e7193330e3765aa9192e033f99f3ea9e02 Mon Sep 17 00:00:00 2001 From: Jean-Pierre LESUEUR Date: Sun, 20 Feb 2022 08:45:28 +0100 Subject: [PATCH] Fix: custom validator when used as module --- .../PowerRemoteDesktop_Server.psd1 | Bin 8390 -> 8390 bytes .../PowerRemoteDesktop_Server.psm1 | 17 ++++++++--------- .../PowerRemoteDesktop_Viewer.psd1 | Bin 8460 -> 8460 bytes .../PowerRemoteDesktop_Viewer.psm1 | 2 +- README.md | 2 +- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/PowerRemoteDesktop_Server/PowerRemoteDesktop_Server.psd1 b/PowerRemoteDesktop_Server/PowerRemoteDesktop_Server.psd1 index 4d96f64238cc53b31baa3d0fe03ce61d0370bae4..f2c2a9cd108a2aa2bcd4b7114616f4034243ccdd 100644 GIT binary patch delta 14 VcmX@+c+7D_5fh`)=3=H`IRGqt1pfd4 delta 14 VcmX@+c+7D_5fh`q=3=H`IRGqh1pNR2 diff --git a/PowerRemoteDesktop_Server/PowerRemoteDesktop_Server.psm1 b/PowerRemoteDesktop_Server/PowerRemoteDesktop_Server.psm1 index 92ed706..2004b42 100644 --- a/PowerRemoteDesktop_Server/PowerRemoteDesktop_Server.psm1 +++ b/PowerRemoteDesktop_Server/PowerRemoteDesktop_Server.psm1 @@ -83,7 +83,7 @@ Add-Type @" } "@ -$global:PowerRemoteDesktopVersion = "3.1.0" +$global:PowerRemoteDesktopVersion = "3.1.2" $global:HostSyncHash = [HashTable]::Synchronized(@{ host = $host @@ -2802,14 +2802,9 @@ function Invoke-RemoteDesktopServer [int] $ListenPort = 2801, [SecureString] $SecurePassword = $null, - [string] $Password = "", - - [ValidateFile()] - [String] $CertificateFile = $null, - - [ValidateBase64String()] + [string] $Password = "", + [String] $CertificateFile = $null, [string] $EncodedCertificate = "", - [switch] $UseTLSv1_3, [switch] $DisableVerbosity, [ClipboardMode] $Clipboard = [ClipboardMode]::Both, @@ -2850,11 +2845,15 @@ function Invoke-RemoteDesktopServer if ($CertificateFile -or $EncodedCertificate) { $Certificate = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 - try { if ($CertificateFile) { + if(-not (Test-Path -Path $CertificateFile)) + { + throw [System.IO.FileNotFoundException]::new() + } + $Certificate = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 $CertificateFile, $CertificatePassword } else diff --git a/PowerRemoteDesktop_Viewer/PowerRemoteDesktop_Viewer.psd1 b/PowerRemoteDesktop_Viewer/PowerRemoteDesktop_Viewer.psd1 index ec21e57cb1570a87a5366962535d8557a91dcf7a..e3c853d11941e25a555981ae4765f6a18f7c95f8 100644 GIT binary patch delta 14 VcmeBi>T%jo#KdT{xtM9D8~`Ug1k(Tj delta 14 VcmeBi>T%jo#KdT@xtM9D8~`UU1knHh diff --git a/PowerRemoteDesktop_Viewer/PowerRemoteDesktop_Viewer.psm1 b/PowerRemoteDesktop_Viewer/PowerRemoteDesktop_Viewer.psm1 index bb2e836..8035676 100644 --- a/PowerRemoteDesktop_Viewer/PowerRemoteDesktop_Viewer.psm1 +++ b/PowerRemoteDesktop_Viewer/PowerRemoteDesktop_Viewer.psm1 @@ -51,7 +51,7 @@ Add-Type @" } "@ -$global:PowerRemoteDesktopVersion = "3.1.0" +$global:PowerRemoteDesktopVersion = "3.1.2" $global:HostSyncHash = [HashTable]::Synchronized(@{ host = $host diff --git a/README.md b/README.md index bc183ea..861eac0 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Tested on: * **Windows 10** * **Windows 11** -Current version: **3.0 Stable** +Current version: **3.1.2 Stable** ## Performance