Table of Contents

Find-PnPFile

SYNOPSIS

Finds a file in the virtual file system of the web.

SYNTAX

Web (Default)

Find-PnPFile [-Match] <String> [-Connection <PnPConnection>] 

List

Find-PnPFile [-Match] <String> -List <ListPipeBind> [-Connection <PnPConnection>]
 

Folder

Find-PnPFile [-Match] <String> -Folder <FolderPipeBind> [-Connection <PnPConnection>]
 

DESCRIPTION

Allows to find a file in the virtual file system of the web.

EXAMPLES

EXAMPLE 1

Find-PnPFile -Match *.master

Will return all masterpages located in the current web.

EXAMPLE 2

Find-PnPFile -List "Documents" -Match *.pdf

Will return all pdf files located in given list.

EXAMPLE 3

Find-PnPFile -Folder "Shared Documents/Sub Folder" -Match *.docx

Will return all docx files located in given folder.

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Folder

Folder object or relative url of a folder to query

Type: FolderPipeBind
Parameter Sets: Folder

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-List

List title, url or an actual List object to query

Type: ListPipeBind
Parameter Sets: List

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Match

Wildcard query using * (any number of charactes) and ? (single character)

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: True

Microsoft 365 Patterns and Practices