Remove-SCFabricRoleResource

Removes a fabric role resource.

Syntax

Remove-SCFabricRoleResource
      [-VMMServer <ServerConnection>]
      [-FabricResource] <FabricRoleResource>
      [-Force]
      [-RunAsynchronously]
      [-PROTipID <Guid>]
      [-JobVariable <String>]
      [-OnBehalfOfUser <String>]
      [-OnBehalfOfUserRole <UserRole>]
      [<CommonParameters>]

Description

The Remove-SCFabricRoleResource cmdlet removes a fabric role resource.

Examples

Example 1: Remove a fabric role resource

PS C:\> $NetworkService = Get-SCNetworkService -Name "ns"
PS C:\> $FabricRole = Get-SCFabricRole -NetworkService $NetworkService -Name "fr"
PS C:\> $ServiceFabricRoleResource = $FabricRole.Services | where { $_.ID -eq "775aaefb-1df1-408d-bd1f-e9ffe64c14ae" }
PS C:\> Remove-SCFabricRoleResource -FabricResource $ServiceFabricRoleResource

The first command gets a network service by using the Get-SCNetworkService cmdlet, and then stores it in the $NetworkService variable.

The second command gets a fabric role for the service in $NetworkService by using the Get-SCFabricRole cmdlet, and then stores it in the $FabricRole variable.

The third command gets a specified service, and stores that resource in the $ServiceFabricRoleResource variable.

The final command removes the resource in $ServiceFabricRoleResource.

Parameters

-FabricResource

Specifies the fabric role resource to remove.

Type:FabricRoleResource
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Force

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-JobVariable

Specifies that job progress is tracked and stored in the variable named by this parameter.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-OnBehalfOfUser

Specifies a user name. This cmdlet operates on behalf of the user that this parameter specifies.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-OnBehalfOfUserRole

Specifies a user role. To obtain a user role, use the Get-SCUserRole cmdlet. This cmdlet operates on behalf of the user role that this parameter specifies.

Type:UserRole
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VMMServer

Specifies a VMM server object.

Type:ServerConnection
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False