Trabalhei, precisei de ()
no final de EnumMembers
, DOH!
Eu tenho um script powershell para enumerar os membros dos membros da função do SQL Server usando o powershell. Eu tenho esse script
<... cut the connection details for brevity,
$SqlInstance is a Microsoft.SqlServer.Management.Smo.Server object ...>
$db = $SqlInstance.Databases[$Database]
foreach ($role in $db.Roles)
{
foreach ($memberlist in $role.EnumMembers)
{
foreach ($member in $memberlist)
{
Write-Host ($member)
}
}
}
Eu recebo uma saída assim:
System.Collections.Specialized.StringCollection EnumMembers()
System.Collections.Specialized.StringCollection EnumMembers()
System.Collections.Specialized.StringCollection EnumMembers()
System.Collections.Specialized.StringCollection EnumMembers()
System.Collections.Specialized.StringCollection EnumMembers()
System.Collections.Specialized.StringCollection EnumMembers()
System.Collections.Specialized.StringCollection EnumMembers()
System.Collections.Specialized.StringCollection EnumMembers()
System.Collections.Specialized.StringCollection EnumMembers()
System.Collections.Specialized.StringCollection EnumMembers()
Como eu realmente vejo os membros da função? Confuso.