Remove HPOVResource - HewlettPackard/POSH-HPEOneView GitHub Wiki

HPE OneView 4.10 Library

Remove-HPOVResource

Remove existing resource(s).

SYNTAX

Remove-HPOVResource [-InputObject] <Object> [-ApplianceConnection] <Object>[ [-force] <SwitchParameter>] [<CommonParameters>]

Detailed Description

Removes a resource identified by either the resource uri or a resource object. Remove-HPOVResource can be called with either -nameOrUri or -resource.

*** This cmdlet will not prompt for delete confirmation. Please use with caution. ***

Parameters

-ApplianceConnection <Object>

Aliases [-Appliance]

Specify one HPOneView.Appliance.Connection object or Name property value. If Resource object is provided via Pipeline, the ApplianceConnection property of the object will be used.

Default Value: ${Global:ConnectedSessions} | ? Default

Aliases Appliance
Required? true
Position? 1
Default value (${Global:ConnectedSessions} | ? Default)
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters?    False

-InputObject <Object>

Aliases [-ro, -name, -uri, -nameOruri] A resource to be deleted. Value can be either resource object, Name or URI.

Aliases ro, nameOruri, uri, name, Resource
Required? true
Position? 0
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters?    False

-force <SwitchParameter>

Invoke switch force-delete the resource when OneView can no longer communicate with the resource and removal is needed. -Force is not a PowerShell option, rather an HPE OneView API feature. This does not override the -Confirm PowerShell option. Not all resources support force-delete.

Aliases None
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters?    False

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216)

Input Types

System.Management.Automation.PSCustomObject

A valid resource object first retrieved by a call to a Get-HPOV*** cmdlet

Return Values

System.Management.Automation.PSCustomObject

Removal async task

Examples

 -------------------------- EXAMPLE 1 --------------------------

Remove-HPOVResource -Resource "/rest/resource/1234-5678-9123"

Removes the resource specified by the URI.

 -------------------------- EXAMPLE 2 --------------------------

Remove-HPOVResource -nameOrUri "ServerProfile-A"

Removes the resource named "ServerProfile-A". If multiple resources exist with the name "ServerProfile-A", an error is returned.

 -------------------------- EXAMPLE 3 --------------------------

$MyResourceObject = send-hpovrequest "/rest/resource/1234-5678-9123" Remove-HPOVResource -Resource $MyResourceObject

Removes the resource $MyReSourceObject.

Related Links


Top

HPE OneView 4.00 Library

Remove-HPOVResource

Remove existing resource(s).

SYNTAX

Remove-HPOVResource [-InputObject] <Object> [-ApplianceConnection] <Object>[ [-force] <SwitchParameter>] [<CommonParameters>]

Detailed Description

Removes a resource identified by either the resource uri or a resource object. Remove-HPOVResource can be called with either -nameOrUri or -resource.

*** This cmdlet will not prompt for delete confirmation. Please use with caution. ***

Parameters

-ApplianceConnection <Object>

Aliases [-Appliance]

Specify one HPOneView.Appliance.Connection object or Name property value. If Resource object is provided via Pipeline, the ApplianceConnection property of the object will be used.

Default Value: ${Global:ConnectedSessions} | ? Default

Aliases Appliance
Required? true
Position? 1
Default value (${Global:ConnectedSessions} | ? Default)
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters?    False

-InputObject <Object>

Aliases [-ro, -name, -uri, -nameOruri] A resource to be deleted. Value can be either resource object, Name or URI.

Aliases ro, nameOruri, uri, name, Resource
Required? true
Position? 0
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters?    False

-force <SwitchParameter>

Invoke switch force-delete the resource when OneView can no longer communicate with the resource and removal is needed. -Force is not a PowerShell option, rather an HPE OneView API feature. This does not override the -Confirm PowerShell option. Not all resources support force-delete.

Aliases None
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters?    False

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216)

Input Types

System.Management.Automation.PSCustomObject

A valid resource object first retrieved by a call to a Get-HPOV*** cmdlet

Return Values

System.Management.Automation.PSCustomObject

Removal async task

Examples

 -------------------------- EXAMPLE 1 --------------------------

Remove-HPOVResource -Resource "/rest/resource/1234-5678-9123"

Removes the resource specified by the URI.

 -------------------------- EXAMPLE 2 --------------------------

Remove-HPOVResource -nameOrUri "ServerProfile-A"

Removes the resource named "ServerProfile-A". If multiple resources exist with the name "ServerProfile-A", an error is returned.

 -------------------------- EXAMPLE 3 --------------------------

$MyResourceObject = send-hpovrequest "/rest/resource/1234-5678-9123" Remove-HPOVResource -Resource $MyResourceObject

Removes the resource $MyReSourceObject.

Related Links


Top
⚠️ **GitHub.com Fallback** ⚠️