Skip to content

Commit 0f3b343

Browse files
committed
Updating documentation to clarify that a full URL can now also be used
1 parent fd1d70a commit 0f3b343

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

documentation/Get-PnPFile.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,40 +53,47 @@ Retrieves the file and downloads it to the current folder
5353

5454
### EXAMPLE 2
5555
```powershell
56+
Get-PnPFile -Url "https://contoso.sharepoint.com/sites/project/Shared Documents/Document.docx"
57+
```
58+
59+
Retrieves the file and downloads it to the current folder
60+
61+
### EXAMPLE 3
62+
```powershell
5663
Get-PnPFile -Url /sites/project/SiteAssets/image.jpg -Path c:\temp -FileName image.jpg -AsFile
5764
```
5865

5966
Retrieves the file and downloads it to c:\temp\image.jpg
6067

61-
### EXAMPLE 3
68+
### EXAMPLE 4
6269
```powershell
6370
Get-PnPFile -Url /sites/project/_catalogs/themes/15/company.spcolor -AsString
6471
```
6572

6673
Retrieves the contents of the file as text and outputs its contents to the console
6774

68-
### EXAMPLE 4
75+
### EXAMPLE 5
6976
```powershell
7077
Get-PnPFile -Url /sites/project/Shared Documents/Folder/Presentation.pptx -AsFileObject
7178
```
7279

7380
Retrieves the file and returns it as a File object
7481

75-
### EXAMPLE 5
82+
### EXAMPLE 6
7683
```powershell
7784
Get-PnPFile -Url /sites/project/_catalogs/themes/15/company.spcolor -AsListItem
7885
```
7986

8087
Retrieves the file and returns it as a ListItem object
8188

82-
### EXAMPLE 6
89+
### EXAMPLE 7
8390
```powershell
8491
Get-PnPFile -Url /personal/john_tenant_onmicrosoft_com/Documents/Sample.xlsx -Path c:\temp -FileName Project.xlsx -AsFile
8592
```
8693

8794
Retrieves the file Sample.xlsx by its site relative URL from a OneDrive for Business site and downloads it to c:\temp\Project.xlsx
8895

89-
### EXAMPLE 7
96+
### EXAMPLE 8
9097
```powershell
9198
Get-PnPFile -Url "/sites/templates/Shared Documents/HR Site.pnp" -AsMemoryStream
9299
```
@@ -250,4 +257,4 @@ Accept wildcard characters: False
250257
251258
## RELATED LINKS
252259
253-
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
260+
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)

0 commit comments

Comments
 (0)