mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-09 13:04:59 +02:00
Add open-rdp.ps1
This commit is contained in:
21
Scripts/open-rdp.ps1
Normal file
21
Scripts/open-rdp.ps1
Normal 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
|
Reference in New Issue
Block a user