2024-10-01 15:11:03 +02:00
|
|
|
|
<#
|
2023-09-26 13:16:28 +02:00
|
|
|
|
.SYNOPSIS
|
|
|
|
|
Opens the RDP app
|
|
|
|
|
.DESCRIPTION
|
|
|
|
|
This script launches the Remote Desktop Protocol (RDP) application.
|
2023-09-26 13:21:02 +02:00
|
|
|
|
NOTE: Documentation of mstsc at: https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/mstsc
|
2023-09-26 13:16:28 +02:00
|
|
|
|
.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
|