I have an issue with my Sitecore PowerShell script. It runs without errors and returns the expected result when I test it in PowerShell ISE. But when I add exactly the same script to PSE reports and try to run it from the reporting menu, the script throws the following error:
Get-ChilItem: A parameter cannot be found that matches parameter name 'Language'.
This is the line where the error is thrown:
$itemsToProcess = Get-ChildItem -Path $startPath -Language * -Recurse
What could be causing this error? Why does my script work in the ISE but not in the reporting menu?