File System - Clean Directory step template errors out

For some reason, the File System - Clean Directory step template is erroring out on one of our tentacles:

WARNING: Some imported command names include unapproved verbs which might make
Info 14:38:40
them less discoverable. Use the Verbose parameter for more detail or type
Info 14:38:40
Get-Verb to see the list of approved verbs.
Info 14:38:40
Cleaning files from installation directory
Info 14:38:40
Include: LCF*..config;web..config
Info 14:38:40
Ignore:
Info 14:38:40
Paths To Clean: C:\Octopus\Applications\Internal\RasterImage3.Host\2.0.1.0
Info 14:38:40
Scanning directory C:\Octopus\Applications\Internal\RasterImage3.Host\2.0.1.0
Error 14:38:40
ForEach-Object : A parameter cannot be found that matches parameter name ‘File’

In an effort to track this down, I would like to run this script locally in the ISE from that box.

I see this in the code:

Running outside octopus

param(
[string]$cleanInclude,
[string]$cleanIgnore,
[string]$pathsToClean,
[switch]$whatIf
)

How do you manually invoke this script from outside octopus in the ISE?

Figured out how to save and execute the script. Looks like the following line causes error:

return Get-ChildItem -Path $path -Filter $filter -Recurse:$recursive -File

Ok, it appears that this script requires Powershell 3.0 or greater to run. Apparently, Powershell 2.0 it blows up.

Hi,

I am sorry that you had this issue, and I am glad you found the reason. Thanks for pointing it out to us.
I’ve created a GitHub issue that you can track at the below link as it should work in 2.0.
ttps://github.com/OctopusDeploy/Issues/issues/1109

Cheers!
Vanessa