1
Get-ChildItem -Recurse -Filter "*" -Include "*.coffee" | Select -propert FullName

This returns a list of all coffee script files in my project.

How can I transform this into a single list where the .coffee part is converted to .js and .js.map?

Example pseudocode output:

[ something.coffee, somethingelse.coffee ]
[ something.js, something.js.map, somethingelse.js, somethingelse.js.map]
4

1 回答 1

1

您可以使用该BaseName属性:

Get-ChildItem -Recurse -Filter "*" -Include "*.coffee" | Foreach-Object {
    '{0}.js' -f $_.BaseName
    '{0}.js.map' -f $_.BaseName    
}
于 2016-07-27T09:01:00.483 回答