< Back

Remove-GlpiToolsItems

Mon Jan 13, 2020 10:16 pm

NAME Remove-GlpiToolsItems



SYNOPSIS

Function Remove an object existing in GLPI.





SYNTAX

Remove-GlpiToolsItems -RemoveFrom <String> -ItemId <Int32> [-Purge] [<CommonParameters>]



Remove-GlpiToolsItems -RemoveFrom <String> -HashtableToRemove <Hashtable> [-Purge] [<CommonParameters>]



Remove-GlpiToolsItems -RemoveFrom <String> [-JsonPayload <Array>] [-Purge] [<CommonParameters>]





DESCRIPTION

Remove an object existing in GLPI. You can choose between every items in Asset Tab.





PARAMETERS

-RemoveFrom <String>

Parameter specify where you want to Remove object.

You can add your custom parameter options to Parameters.json file located in Private folder



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ItemId <Int32>

Paremter which indicate on item id to Remove.



Required? true

Position? named

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-HashtableToRemove <Hashtable>



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-JsonPayload <Array>

Parameter specify a hashtable with "input" parameter to be a JsonPayload.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Purge [<SwitchParameter>]

Switch parameter boolean, if the itemtype have a trashbin, you can force purge (Remove finally). Optional.



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 (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

Id of item, hashtable, JsonPayload.





OUTPUTS

Information with id and message, which items were added.





NOTES





PSP 04/2019



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



PS C:\\>Remove-GlpiToolsItems -RemoveFrom Computer -ItemId 1



Command will Remove item with id 1, and put item into trashbin.









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



PS C:\\>Remove-GlpiToolsItems -RemoveFrom Computer -ItemId 1 -Purge



Command will Remove item with id 1. Command will Remove item from trashbin too.









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



PS C:\\>$example = @{id = "1"}



PS C:\\> Remove-GlpiToolsItems -RemoveFrom Computer -HashtableToRemove $example

Example will Remove item from Computers.









-------------------------- EXAMPLE 4 --------------------------



PS C:\\>$example = "@



{

"input" : [

{

"id" : "1"

},

{

"id" : "2"

}

]

}

@"

PS C:\\> Remove-GlpiToolsItems -RemoveFrom Computer -JsonPayload $example

Example will Add items into Computers











RELATED LINKS