Private/Auth/Get-HydrationFreeTcpPort.ps1
|
function Get-HydrationFreeTcpPort { [CmdletBinding()] param() $listener = [System.Net.Sockets.TcpListener]::new([System.Net.IPAddress]::Loopback, 0) $listener.Start() try { return $listener.LocalEndpoint.Port } finally { $listener.Stop() } } |