I have the following simple New-PSSession script that I run to connect to my exchange 2010 server.
How can I setup the script to detect if the session is already active and do nothing, else open the session.
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://test.mydomain.org/PowerShell/ -Authentication Kerberos Import-PSSession $Session -ErrorAction Stop