Copy-PorteoSite.ps1
<# .Synopsis Copy-PorteoSite -SrcConnection $srcConn -DestConnection $dstConn .Description This function copies the site specified by the `-SrcConnection` argument and copies it to the destination site specified by the `-DestConnection argument. .Example $srcSite = "https://client1.sharepoint.com/sites/BaseSite" $dstSite = "https://client2.sharepoint.com/sites/NewSite" $srcCreds = Get-Credential $dstCreds = Get-Credential $srcConn = Connect-PnPOnline -Url $srcSite -Credentials $srcCreds $dstConn = Connect-PnPOnline -Url $dstSite -Credentials $dstCreds Copy-PorteoSite -SrcConnection $srcConn -DestConnection $dstConn #> function Copy-PorteoSite { param( $srcConnection = (Get-PnPConnection), $destConnection = (Get-PnPConnection) ) # Copy Lists and Site Assets $ignore = Set-PnpSite -NoScriptSite $false -Connection $destConnection $ignore = Copy-PorteoLists -SrcConnection $srcConnection -DestConnection $destConnection $ignore = Copy-PorteoFolders -SrcConnection $srcConnection -DestConnection $destConnection } |