recursion
1 TopicGet all OneDrive for Business folders recursively
I have a litte problem. I'm migrating OneDrives between Office 365 tenants. In the receiving end they require that all documents have a major version. In the orginating end there are a few users that have turned on Minor versions i the versioning settings. This requires me to check-out and check-in files to raise all files to major version. . Using Office 365 Dev PnP PowerShell CmdLets (SharePointPNPPowerShellOnline) I created this little nifty function. Function checkin-allfiles { [cmdletbinding()] param ( [Parameter (position = 0,HelpMessage = 'The Folder Site Relative URL (/Documents)', Mandatory = $TRUE)] [String]$FSRU ) $files = Get-PnPFolderItem -FolderSiteRelativeUrl $FSRU -ItemType File foreach ($file in $files) { Set-PnPFileCheckedOut -Url $file.ServerRelativeUrl -Verbose Set-PnPFileCheckedIn -Url $file.ServerRelativeUrl -CheckinType MajorCheckIn -Comment 'Checked In with Script to raise version to major' -Verbose } } My problem is recursively running this function on all subfolders. Can anyone help me out?11KViews0likes2Comments