< Back

Update-GlpiToolsItems

Mon Jan 13, 2020 10:20 pm

NAME Update-GlpiToolsItems



SYNOPSIS

Function Update an object (or multiple objects) existing in GLPI.





SYNTAX

Update-GlpiToolsItems -UpdateTo <String> -ItemId <Int32> -ItemsHashtableWithoutId <Hashtable> [<CommonParameters>]



Update-GlpiToolsItems -UpdateTo <String> -JsonPayload <Array> [<CommonParameters>]





DESCRIPTION

Function Update an object (or multiple objects) into GLPI. You can choose between every items in Asset Tab.\\





PARAMETERS

-UpdateTo <String>

Parameter specify where you want to update 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>

Parameter specify item id. You can find id in GLPI or, when you run Get-GlpiToolsComputer function.



Required? true

Position? named

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-ItemsHashtableWithoutId <Hashtable>

Parameter specify a hashtable without id of item to be updated, and others fields.

You provide id in -ItemId parameter.

You can get values to use, when you run Get-GlpiToolsComputer function.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-JsonPayload <Array>

Parameter specify a JsonPayload with id of item to be updated, and others fields. You can get values to use,

when you run Get-GlpiToolsComputer function.



Required? true

Position? named

Default value

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

JsonPayload, or hashtable.





OUTPUTS

Information with id and message, which items were Updated.





NOTES





PSP 04/2019



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



PS C:\\>$example = "@



{

"input" : [

{

"id" : "15",

"comment" : "updated from script 4"

},

{

"id" : "17",

"comment" : "updated from script 2"

}

]

}

@"

PS C:\\> Update-GlpiToolsItems -UpdateTo Computer -JsonPayload $example

Example will Update item which id is 15 and 17 into Computers









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



PS C:\\>$example = @{name = "test"}



PS C:\\> Update-GlpiToolsItems -UpdateTo Computer -ItemId 5 -ItemsHashtableWithoutId $example

Example will Update item which id is 5 into Computers











RELATED LINKS