Gets the instance name of the instance of SQL Server.
[SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase)] public string InstanceName { get; }
The InstanceName property specifies the name of the instance of SQL Server. This is usually the computer name but it may be a named instance that was specified during setup. InstanceName will return an empty string for the default instance.
C#
Console.WriteLine(srv.InstanceName)
PowerShell
Write-Host $srv.InstanceName