Created
December 13, 2013 16:47
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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