Test‑SqlDscIsRole - dsccommunity/SqlServerDsc GitHub Wiki
Returns whether the database principal exists and is a database role.
Test-SqlDscIsRole [-ServerObject] <Server> [-Name] <String>
[<CommonParameters>]
Returns whether the database principal exist and is a database role.
$serverInstance = Connect-SqlDscDatabaseEngine
Test-SqlDscIsRole -ServerObject $serverInstance -Name 'MyPrincipal'
Returns $true if the principal exist as role, if not $false is returned.
Specifies the name of the database principal.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies current server connection object.
Type: Server
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.