< Back

Search-GlpiToolsItems

Mon Jan 13, 2020 10:17 pm

NAME Search-GlpiToolsItems



SYNOPSIS

Function is using GLPI Search Engine to get informations.





SYNTAX

Search-GlpiToolsItems [-SearchFor] <String> [-SearchType] <String> [[-SearchField] <String>] [-SearchValue]

<String> [[-SearchInTrash] <String>] [<CommonParameters>]





DESCRIPTION

Function Search for specific component in GLPI

Parameters are the names of options in GLPI

Remember that, names used in cmdlet coming from glpi URL, and can be hard to understand, but most of them are

intuitional.

To get name you always have to look at the URL in GLPI, for example "http://glpi/front/computer.php" where

"computer" is the name to use in parameter.





PARAMETERS

-SearchFor <String>

You can use this function with -SearchFor parameter.

Using TAB button you can choose desired option.

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



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SearchType <String>

You can use this function with -SearchType parameter.

Using TAB button you can choose desired option.



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SearchField <String>

You can use this function with -SearchField parameter.

This is an optional parameter, default value is 1 which is called Name in GLPI.

This parameter can take pipeline input, even from Get-GlpiToolsListSearchOptions cmdlet.



Required? false

Position? 3

Default value 1

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-SearchValue <String>

You can use this function with -SearchValue parameter.

This parameter can take pipeline input.

Provide value to the function, which is used to search for.



Required? true

Position? 4

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-SearchInTrash <String>



Required? false

Position? 5

Default value No

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

Only for -SearchValue, and -SearchField.





OUTPUTS

Function returns PSCustomObject with property's of Search results from GLPI





NOTES





PSP 02/2019



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



PS C:\\>Search-GlpiToolsItems -SearchFor Computer -SearchType contains -SearchValue DC



Example will show every asset which contains value "DC" in the Name from Asset->Computers.









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



PS C:\\>Search-GlpiToolsItems -SearchFor Computer -SearchType contains -SearchValue DC -SearchField 1



Example will show every asset which contains value "DC" in the Name from Asset->Computers.

SearchFiled can be retrieved from Get-GlpiToolsListSearchOptions cmdlet, you can provide it throught pipeline.









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



PS C:\\>Search-GlpiToolsItems -SearchFor Computer -SearchType contains -SearchValue DC -SearchField 1 -SearchInTrash



Example will show every asset which contains value "DC" in the Name from Asset->Computers.

SearchFiled can be retrieved from Get-GlpiToolsListSearchOptions cmdlet, you can provide it throught pipeline.

SearchInTrash will allow you to search for assets from trash.











RELATED LINKS