Share via

Get-SPOSiteScriptFromWeb: A parameter cannot be found that matches parameter name 'IncludeLists'.

clarky000 60 Reputation points
2025-03-26T02:52:12.68+00:00

Im running Get-SPOSiteScriptFromWeb and getting "A parameter cannot be found that matches parameter name 'IncludeLists'." Here is the full script:

$adminSiteUrl = "https://tenancy-admin.sharepoint.com/"

$siteUrl = "https://tenancy.sharepoint.com/sites/sitename"

$relativeListUrls = ("/Lists/Budget%20tracker%202024", "/Lists/Content%20scheduler", "/Lists/Content%20scheduler")

Connect-SPOService $adminSiteUrl

Get-SPOSiteScriptFromWeb –WebUrl $siteUrl -IncludeTheme -IncludeBranding -IncludeSiteExternalSharingCapability –IncludeRegionalSettings -IncludeLinksToExportedItems -IncludeLists $relativeListUrls

Could I be running an old version of Microsoft.Online.SharePoint.PowerShell? This is the returned version:

Get-Module -Name Microsoft.Online.SharePoint.PowerShell -ListAvailable | Select Name,Version

Name Version


Microsoft.Online.SharePoint.PowerShell 16.0.25814.12000

Microsoft 365 and Office | SharePoint | Development
0 comments No comments

1 answer

Sort by: Most helpful
  1. Xyza Xue_MSFT 30,256 Reputation points Microsoft External Staff
    2025-03-26T06:43:28.41+00:00

    Hi @clarky000 ,

    Thank you for your posting.

    Get-SPOSiteScriptFromWeb: A parameter cannot be found that matches parameter name 'IncludeLists'.

    The Get-SPOSiteScriptFromWeb statement in Microsoft.Online.SharePoint.PowerShell Module supports the parameter IncludedLists, which is spelled incorrectly in your code, try correcting it and rerunning it. Hope this can help you.

    User's image


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.