You can go through this link - https://www.nishtech.com/Blog/2020/April/Advanced-content-packaging-with-Powershell
Step 1 - Use Powershell Reports to get the modified items CSV file
To find the Powershell Reports, open the Sitecore in Desktop Mode, then click at the Reporting Tools menu item, as shown in the image below.
In our example, we are using the “Items last updated after date“ report. In the configuration pop-up, select the Report Root in the content tree, and the After Date and Time.
Since we are deploying our Sprint content, we will input the date when the Sprint actually started, so the resulting list will only include the items modified during the sprint.
The reporting results can be conveniently browsed and reviewed. Double-clicking a row will pop-up the item in Content Editor.
Go ahead and download the CSV file by clicking in the highlighted icon.
Step 2 - Open and Review in Excel
The CSV file generated in the last step can now be opened in Excel, enabling your team to easily review and modify the file by using Excel features such as Sort and Filter.
Your team can be consulted to confirm which of their items are supposed to be included in the package, and what should not be there. For that, you can use the “Updated by“ column to identify the user who modified the items.
Feel free to modify the file as you want, removing the lines that should not be included. As long as the column names are kept, and you have no empty rows, it should be good.
Step 3 - Convert the CSV file into a Sitecore Package
Now that your spreadsheet is properly revised and adjusted, we will use it to generate the Sitecore Package with the items present in your CSV file.
For that, you will need the following Custom Powershell Script - Create Package from Report CSV file.ps1
- Powershell Script itself
- Sitecore Package for quick installation
If you either install the package above or manually create the script under the path
/sitecore/system/Modules/PowerShell/Script Library/Package Generator/Toolbox, you will then be able to trigger this script from the Powershell Toolbox.
The script will prompt the user to upload the revised CSV file.
After finished, the user is prompted to download the generated package
Step 4 - Install the package
When the time comes, use the Sitecore Installation Wizard to install the package - don’t forget to trigger a publish when the installation finishes!