Skip to content

spo page clientsidewebpart add - Can't pass values to WebPart Properties in PowerShell #1311

Answered by ypcode
WayneJSawyer asked this question in General
Discussion options

You must be logged in to vote

Hi Wayne,

Regarding your attempts, there is a tiny thing but quite important that is missing: The back ticks ( ` ) surrounding your JSON string
e.g.

o365 spo page clientsidewebpart add --webUrl $SiteUrl --pageName $PageName --webPartId $AppWebPartID --debug --section 1 --column 1 --webPartProperties --% `"{""apiUrl"":""https://www.google.com""}"`

Notice that, to avoid the need of using $(), you can put the --% just before the string to escape (like in your third attempt, but remind the back ticks :) )

I've been trying a few things regarding your scenario and here is what I come up with which works just fine on my machine with properties resolved from PowerShell variables so you can really…

Replies: 9 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by garrytrinder
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@garrytrinder
Comment options

@ypcode
Comment options

@garrytrinder
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants