Skip to content

Commit

Permalink
Fix: custom validator when used as module
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkCoderSc committed Feb 20, 2022
1 parent a52936e commit baf608e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
Binary file modified PowerRemoteDesktop_Server/PowerRemoteDesktop_Server.psd1
Binary file not shown.
17 changes: 8 additions & 9 deletions PowerRemoteDesktop_Server/PowerRemoteDesktop_Server.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Add-Type @"
}
"@

$global:PowerRemoteDesktopVersion = "3.1.0"
$global:PowerRemoteDesktopVersion = "3.1.2"

$global:HostSyncHash = [HashTable]::Synchronized(@{
host = $host
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
Binary file modified PowerRemoteDesktop_Viewer/PowerRemoteDesktop_Viewer.psd1
Binary file not shown.
2 changes: 1 addition & 1 deletion PowerRemoteDesktop_Viewer/PowerRemoteDesktop_Viewer.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Add-Type @"
}
"@

$global:PowerRemoteDesktopVersion = "3.1.0"
$global:PowerRemoteDesktopVersion = "3.1.2"

$global:HostSyncHash = [HashTable]::Synchronized(@{
host = $host
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Tested on:
* **Windows 10**
* **Windows 11**

Current version: **3.0 Stable**
Current version: **3.1.2 Stable**

## Performance

Expand Down

0 comments on commit baf608e

Please sign in to comment.