Retrieve Oracle instance port number using PowerShell | REGEX

Posted on

A requirement popped up to get the Oracle instance(s) port number before building a connection string for establishing a connection. Team used tnsping utility which returns results like shown below TNS Ping Utility for 64-bit Windows: Version – Production on 09-MAR-2018 04:44:04 Copyright (c) 1997, 2013, Oracle. All rights reserved. Used parameter files: D:\app\oracle\product\11.2.0\network\admin\sqlnet.ora […]