File tree 1 file changed +13
-6
lines changed
1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -53,40 +53,47 @@ Retrieves the file and downloads it to the current folder
53
53
54
54
### EXAMPLE 2
55
55
``` 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
56
63
Get-PnPFile -Url /sites/project/SiteAssets/image.jpg -Path c:\temp -FileName image.jpg -AsFile
57
64
```
58
65
59
66
Retrieves the file and downloads it to c:\temp\image.jpg
60
67
61
- ### EXAMPLE 3
68
+ ### EXAMPLE 4
62
69
``` powershell
63
70
Get-PnPFile -Url /sites/project/_catalogs/themes/15/company.spcolor -AsString
64
71
```
65
72
66
73
Retrieves the contents of the file as text and outputs its contents to the console
67
74
68
- ### EXAMPLE 4
75
+ ### EXAMPLE 5
69
76
``` powershell
70
77
Get-PnPFile -Url /sites/project/Shared Documents/Folder/Presentation.pptx -AsFileObject
71
78
```
72
79
73
80
Retrieves the file and returns it as a File object
74
81
75
- ### EXAMPLE 5
82
+ ### EXAMPLE 6
76
83
``` powershell
77
84
Get-PnPFile -Url /sites/project/_catalogs/themes/15/company.spcolor -AsListItem
78
85
```
79
86
80
87
Retrieves the file and returns it as a ListItem object
81
88
82
- ### EXAMPLE 6
89
+ ### EXAMPLE 7
83
90
``` powershell
84
91
Get-PnPFile -Url /personal/john_tenant_onmicrosoft_com/Documents/Sample.xlsx -Path c:\temp -FileName Project.xlsx -AsFile
85
92
```
86
93
87
94
Retrieves the file Sample.xlsx by its site relative URL from a OneDrive for Business site and downloads it to c:\temp\Project.xlsx
88
95
89
- ### EXAMPLE 7
96
+ ### EXAMPLE 8
90
97
``` powershell
91
98
Get-PnPFile -Url "/sites/templates/Shared Documents/HR Site.pnp" -AsMemoryStream
92
99
```
@@ -250,4 +257,4 @@ Accept wildcard characters: False
250
257
251
258
## RELATED LINKS
252
259
253
- [Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
260
+ [Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
You can’t perform that action at this time.
0 commit comments