<# .SYNOPSIS This script runs ssh with the port specified in '$instdir/etc/conf.d/gogo-ssh.conf', where $instdir is the installation directory read from the registry entry hklm:\SOFTWARE\osgi-runner\Instdir IF the port could not be found in this config file, the default port 8101 is assumed. .NOTES SVN-Release: $Id$ #> $instdir = Get-ItemPropertyValue -Path hklm:\SOFTWARE\osgi-runner -Name Instdir $port = Get-Content $instdir\etc\conf.d\gogo-ssh.properties | foreach { $line = [regex]::split($_,"\s*=\s*") if ($line[0] -eq "gogo.ssh.port") { write-output $line[1]; } } if ($port) { write-host "Using port $port to connect to OSGi console..." } else { write-host "Using default port 8101 to connect to OSGi console..." $port="8101" } ssh.exe -p $port localhost