Add open-rdp.ps1

This commit is contained in:
Markus Fleschutz
2023-09-26 13:16:28 +02:00
parent e518b37d92
commit 580275de6e
3 changed files with 23 additions and 4 deletions

21
Scripts/open-rdp.ps1 Normal file
View File

@ -0,0 +1,21 @@
<#
.SYNOPSIS
Opens the RDP app
.DESCRIPTION
This script launches the Remote Desktop Protocol (RDP) application.
.EXAMPLE
PS> ./open-rdp.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz | License: CC0
#>
param([string]$hostname = "")
if ($hostname -eq "") {
& Start-Process "$env:windir\system32\mstsc.exe"
} else {
& Start-Process "$env:windir\system32\mstsc.exe" -ArgumentList "/v:$hostname"
}
exit 0 # success