Skip to content

Commit baf608e

Browse files
committed
Fix: custom validator when used as module
1 parent a52936e commit baf608e

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed
Binary file not shown.

PowerRemoteDesktop_Server/PowerRemoteDesktop_Server.psm1

+8-9
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Add-Type @"
8383
}
8484
"@
8585

86-
$global:PowerRemoteDesktopVersion = "3.1.0"
86+
$global:PowerRemoteDesktopVersion = "3.1.2"
8787

8888
$global:HostSyncHash = [HashTable]::Synchronized(@{
8989
host = $host
@@ -2802,14 +2802,9 @@ function Invoke-RemoteDesktopServer
28022802
[int] $ListenPort = 2801,
28032803

28042804
[SecureString] $SecurePassword = $null,
2805-
[string] $Password = "",
2806-
2807-
[ValidateFile()]
2808-
[String] $CertificateFile = $null,
2809-
2810-
[ValidateBase64String()]
2805+
[string] $Password = "",
2806+
[String] $CertificateFile = $null,
28112807
[string] $EncodedCertificate = "",
2812-
28132808
[switch] $UseTLSv1_3,
28142809
[switch] $DisableVerbosity,
28152810
[ClipboardMode] $Clipboard = [ClipboardMode]::Both,
@@ -2850,11 +2845,15 @@ function Invoke-RemoteDesktopServer
28502845
if ($CertificateFile -or $EncodedCertificate)
28512846
{
28522847
$Certificate = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
2853-
28542848
try
28552849
{
28562850
if ($CertificateFile)
28572851
{
2852+
if(-not (Test-Path -Path $CertificateFile))
2853+
{
2854+
throw [System.IO.FileNotFoundException]::new()
2855+
}
2856+
28582857
$Certificate = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 $CertificateFile, $CertificatePassword
28592858
}
28602859
else
Binary file not shown.

PowerRemoteDesktop_Viewer/PowerRemoteDesktop_Viewer.psm1

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Add-Type @"
5151
}
5252
"@
5353

54-
$global:PowerRemoteDesktopVersion = "3.1.0"
54+
$global:PowerRemoteDesktopVersion = "3.1.2"
5555

5656
$global:HostSyncHash = [HashTable]::Synchronized(@{
5757
host = $host

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Tested on:
1717
* **Windows 10**
1818
* **Windows 11**
1919

20-
Current version: **3.0 Stable**
20+
Current version: **3.1.2 Stable**
2121

2222
## Performance
2323

0 commit comments

Comments
 (0)