So here´s the problem, i want to schedule a powershell job to copy files and overwrite from SharePoint-onprem to online AND the files metadata (both environments have the same structure).
What i’ve accomplished so far since the copying is done from the on-prem server (W2012 R2) with PowerShell V7 is the following.
Established connection with both environment:
$sourceSite = "" $targetSite = "" $targetConnection = Connect-PnPOnline -Url $targetSite -Credential $onlineCredentials -ReturnConnection $sourceConnection = Connect-PnPOnline -Url $sourceSite -TransformationOnPrem -CurrentCredentials
I can get the file list of the source:
$files = get-pnplistitem -List [listname] -TransformationOnPrem -Connection $sourceConnection
Now to the tricky part… how the pip do i copy the file from the source to the target and toggle through all files?
I´ve done this with pages from on-prem and converted them to modern but i can´t seem to find with command to use. Could anyone assist?