Forum Discussion

My-atix's avatar
My-atix
Copper Contributor
Jan 05, 2023
Solved

Connect-PnPOnline -Connection parameter???

Hi All,   I have a question with regards to the below code... I want add information from a newly created site to a "List" in another site collection.   After debugging the following code I can s...
  • Don Kirkham's avatar
    Jan 08, 2023

    My-atix The Connect-PnPOnline cmdlet has a -ReturnConnection parameter which will return the connection object you are looking for.

     

    Change line 5 in your sample above to 

    $webConnect = Connect-PnPOnline -Url $webUrl -Interactive -ReturnConnection

     

    Good luck!

     

     

    Please click Mark as Best Response & Like if my post helped you to answer or resolve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

Resources