0

I want to save a file with a custom name while using Show-ListView function. Right now, when I am trying to save the file it is returning in this format "report-2019-02-25_095656.csv".

This is the simple script I am running:

$item | Show-ListView -Title "Export Items" -Property ` @{ Name="Item Name"; Expression={$.Name}}, @{ Name="Item ID"; Expression={$.ID}}

I want to save the file as "abc_items.csv". Thanks for your help.

2

There is no option to modify a file name out of the box.

Export to CSV is one of the export options available for ListView.

You will find it here:

/sitecore/system/Modules/PowerShell/Script Library/SPE/Core/Platform/Internal/List View/Export/CSV

Notice that file name is hardcoded in the script.

enter image description here

If you want your own file format you will have to modify this item or create your custom button.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.