< Back

Search-ODItems

Sat Jan 18, 2020 6:05 pm

NAME Search-ODItems



SYNOPSIS





SYNTAX

Search-ODItems [-AccessToken] <String> [[-ResourceId] <String>] [-SearchText] <String> [[-Path] <String>]

[[-ElementId] <String>] [[-SelectProperties] <String>] [[-DriveId] <String>] [<CommonParameters>]





DESCRIPTION

Search for items starting from Path or ElementId.





PARAMETERS

-AccessToken <String>

A valid access token for bearer authorization.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ResourceId <String>

Mandatory for OneDrive 4 Business access. Is the ressource URI: "https://<tenant>-my.sharepoint.com/".

Example: "https://sepagogmbh-my.sharepoint.com/"



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SearchText <String>

Specifies search string.



Required? true

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Path <String>

Specifies the path of the folder to start the search. If not given, the path is "/".



Required? false

Position? 4

Default value /

Accept pipeline input? false

Accept wildcard characters? false



-ElementId <String>

Specifies the element id of the folder to start the search. If Path and ElementId are given, the ElementId is

used with a warning.



Required? false

Position? 5

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SelectProperties <String>

Specifies a comma-separated list of the properties to be returned for file and folder objects (case

sensitive). If not set, name, size, lastModifiedDateTime and id are used. (See

https://dev.onedrive.com/odata/optional ... meters.htm).

If you use -SelectProperties "", all properties are listed. Warning: A complex "content.downloadUrl" is

listed/generated for download files without authentication for several hours.



Required? false

Position? 6

Default value name,size,lastModifiedDateTime,id

Accept pipeline input? false

Accept wildcard characters? false



-DriveId <String>

Specifies the OneDrive drive id. If not set, the default drive is used.



Required? false

Position? 7

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



OUTPUTS



NOTES





Author: Marcel Meurer, marcel.meurer@sepago.de, Twitter: MarcelMeurer



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



PS C:\\>Search-ODItems -AccessToken $AuthToken -Path "/My pictures" -SearchText "FolderA"



Searches for items in a sub folder recursively. Take a look at OneDrives API documentation to see how search

(preview) works (file and folder names, in files, ???????????????)











RELATED LINKS