PoshCode Archive  Artifact [ed849e2691]

Artifact ed849e2691447697debe3bb4a9bf6c0ed93c397c3230127c65315a79c9fc7903:

  • File Edit-RDP.ps1 — part of check-in [bf4231a1b1] at 2018-06-10 14:20:26 on branch trunk — Function/script that opens an RDP file for editing using Terminal Services Client. (user: unknown size: 1543)

# encoding: ascii
# api: powershell
# title: Edit-RDP
# description: Function/script that opens an RDP file for editing using Terminal Services Client.
# version: 0.1
# type: script
# license: CC0
# x-poshcode-id: 675
# x-archived: 2010-08-27T00:48:23
#
# Uncomment the function code to make a global function.
#
########################################################################################################################
# NAME
#     Edit-RDP
#
# SYNOPSIS
#     Opens a RDP file for editing.
#
# SYNTAX
#     Edit-RDP [-Path] <string>
#
# DETAILED DESCRIPTION
#     The Edit-RDP cmdlet opens an existing RDP file for editing using the Microsoft Terminal Services Client.
#
# PARAMETERS
#     -Path <string>
#         Specifies the path to the RDP file.
#
#         Required?                    true
#         Position?                    1
#         Default value                
#         Accept pipeline input?       false
#         Accept wildcard characters?  false
#
# INPUT TYPE
#     
#
# RETURN TYPE
#     
#
# NOTES
#
#     -------------------------- EXAMPLE 1 --------------------------
#
#     C:\PS>Edit-RDP -Path C:\myserver.rdp
#
#
#     This command opens the specified RDP file for edit in Terminal Services Client.
#
#

#Function global:Edit-RDP {
    param(
        [string]$Path = (throw "A path to a RDP file is required.")
    )

    if (Test-Path $path) {
        mstsc.exe /edit $path
    } else {
        throw "Path does not exist."
    }
#}