This is probably a newb question… but I am trying to pull the tcpport information using
$TCPPort = Invoke-sqlcmd -ServerInstance “MyServer\MyInstance” -Query “select value_data from sys.dm_server_registry WHERE value_name = ‘TcpPort’”
but I just want the value to be fed into my TCPPort Variable and what is coming out is
How do I get JUST the 17443 into my variable…
Thank you for any help!