Link to home
Start Free TrialLog in
Avatar of WBC2013
WBC2013

asked on

Powershell script connect-mstsc.ps1 doesnt run

Hi

I am trying to use this ps1 script written by Jaap Brasser.  But it doesnt do anything when I run it and I'm pretty sure I'm missing something very elementary!  

The script is:
http://gallery.technet.microsoft.com/scriptcenter/Connect-Mstsc-Open-RDP-2064b10b

I have tried using "set-executionpolicy Unrestricted"

I get no error message, just a new line in the console as if it worked correctly.  Mstsc.exe doesn't appear.

Can someone point out the obvious for me?

Thanks
Avatar of footech
footech
Flag of United States of America image

Did you read the included help in the script?  Just running the .PS1 file (dot source it to make it available in the global scope) creates the function.  Then you have to run the function, submitting the needed parameters.
Avatar of WBC2013
WBC2013

ASKER

Ah this is the elementary mistake yes.

So I run .\connect-mstsc.ps1

But I get an error when trying to use the connect-mstsc function (as per the help notes).  It says the cmdlet, function or script file is not recognised.

e.g \> connect-mstsc -computerName testPC -user TestUser -password TestPassword
ASKER CERTIFIED SOLUTION
Avatar of footech
footech
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of WBC2013

ASKER

much appreciated!
No problem.  A couple help topics that I think would be helpful and you may want to read are:
about_scope
about_operators