Skip to content

Commit 3d7461d

Browse files
Update Add-PnPPageWebPart.md (#5086)
Co-authored-by: Gautam Sheth <[email protected]>
1 parent c63a82b commit 3d7461d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

documentation/Add-PnPPageWebPart.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,18 @@ Adds a built-in component 'BingMap' to the page called 'MyPage'
5656

5757
### EXAMPLE 2
5858
```powershell
59-
Add-PnPPageWebPart -Page "MyPage" -Component "HelloWorld"
59+
$component = Get-PnPPageComponent -Page "MyPage" -ListAvailable | Where-Object { $_.Name -eq "HelloWorld" }
60+
61+
Add-PnPPageWebPart -Page "MyPage" -Component $component
6062
```
6163

6264
Adds a component 'HelloWorld' to the page called 'MyPage'
6365

6466
### EXAMPLE 3
6567
```powershell
66-
Add-PnPPageWebPart -Page "MyPage" -Component "HelloWorld" -Section 1 -Column 2
68+
$component = Get-PnPPageComponent -Page "MyPage" -ListAvailable | Where-Object { $_.Name -eq "HelloWorld" }
69+
70+
Add-PnPPageWebPart -Page "MyPage" -Component $component -Section 1 -Column 2
6771
```
6872

6973
Adds a component 'HelloWorld' to the page called 'MyPage' in section 1 and column 2

0 commit comments

Comments
 (0)