I am trying to create a script that will be contained in file distributions that copies the files contained and renames the existing files at the endpoint to *.backup – The files do not have uniform extensions, or names.
So far I have tried a couple dozen versions. Apologies for not having posted them.
Im new to powershell, so im struggling to understand how each of the objects is being processed and what I can use as a wildcard and what I cannot.
This is what I have been trying to get working
get-childitem -path $path | rename-item -newname (*.*, *.backup)
I have tried a large number of different methods to change the wild cards including *_.name, "name.$_", $_.
Im not needing a script written, Just need to understand how to create the correct wild card after -newname to leave the file name, and change only the extension.