Public/Start-RDPSpook.ps1
|
Function Start-RDPSpook { <# .Synopsis Starts RDP connection to remote machine .Description Starts RDP connection to remote machine .Example Start-RDPSpook Starts RDP connection to remote machine .LINK about_functions_advanced .LINK about_CommonParameters #> [CmdletBinding()] Param() $local = "casper" If (Test-Connection -ComputerName $local -Count 1 -Quiet) { $rdp = "mstsc" $arg = "/public /v:casper /f" Write-Verbose "Starting $($MyInvocation.Mycommand)..." Start-Process $rdp $arg } else { $rdp = "mstsc" $arg = "/public /v:hetspook.nl /f" Write-Verbose "Starting $($MyInvocation.Mycommand)..." Start-Process $rdp $arg } } |