The following script lists all file in a directory and return their name and path in console.
The result is like:
C:\Projects\company\trunk\www\client\project\customer\start.js
I need instead removing the initial part and having the result like
project\customer\start.js
I am not able to set the right regular expression in Replace. Could you please point me out in the right direction?
Get-ChildItem -Path C:\Projects\company\trunk\www\client\project -Filter *.js -Recurse -File |
Sort-Object Length -Descending |
ForEach-Object {
$_ = $_ -replace '\\C:\Projects\company\trunk\www\client\project', ''
"'" + $_.FullName + "',"
}