Skip to content

Instantly share code, notes, and snippets.

@mitchelldavis
Created December 13, 2013 16:47
Show Gist options
  • Save mitchelldavis/7947239 to your computer and use it in GitHub Desktop.
Save mitchelldavis/7947239 to your computer and use it in GitHub Desktop.
A simple cmdlet that will take care of all the lifting while only asking me for the machine name and credentials.
# All you should have to do to connect to a remote machine is type:
# Remote-Connect <machineIP>
# Then the cmdlet will ask you for your credentials and you can continue.
function Remote-Connect
{
param([Parameter(Mandatory=$true)][string]$machine)
$opt=New-PSSessionOption –skipcacheck
Enter-PsSession $machine -usessl -SessionOption $opt –cred (get-credential)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment