Question:
I have a problem with change extension of a file. I need to write a script which is replicating data, but data have two files. Filename is not a string, so we can’t use normal -replace
I need to get from
1 2 |
filename.number.extension |
this form
1 2 |
filename.number.otherextension |
We try to use a split, but this command show us things like below
1 2 3 4 |
filename number otherextension |
Thanks for any ideas,
Answer:
1 2 |
[System.IO.Path]::ChangeExtension("test.old",".new") |