I'm not a coder. I have a Powershell script .ps1 that goes into all subfolders of "db" and deletes the files I want to delete in all of them. It works for what I need. The following code:
Get-ChildItem "C:\Program Files (x86)\Steam\steamapps\common\Game 2022\data\database\db\*\dbc\permanent" -Include filmename00.dbc -Recurse | Remove-Item -Verbose
Get-ChildItem "C:\Program Files (x86)\Steam\steamapps\common\Game 2022\data\database\db\*\dbc\permanent" -Include filename11.dbc -Recurse | Remove-Item -Verbose
Get-ChildItem "C:\Program Files (x86)\Steam\steamapps\common\Game 2022\data\database\db\*" -Include "filename11.dbc" -Recurse | Remove-Item -Verbose
Get-ChildItem "C:\Program Files (x86)\Steam\steamapps\common\Game 2022\data\database\db\*\dbc\permanent" -Include filmename22.dbc -Recurse | Remove-Item -Verbose
Get-ChildItem "C:\Program Files (x86)\Steam\steamapps\common\Game 2022\data\database\db\*\lnc\all" -Include filmename33.lnc -Recurse | Remove-Item -Verbose
Get-ChildItem "C:\Program Files (x86)\Steam\steamapps\common\Game 2022\data\database\db\*\edt\permanent" -Include filmename44.edt -Recurse | Remove-Item -Verbose
Now I want to copy 2 files in the same way in a generic way to simulate this code above but I don't know how to do it.
I'm using this code to copy the files:
Copy-Item -Path "File to copy 1.lnc" -Destination "C:\Program Files (x86)\Steam\steamapps\common\Game 2022\data\database\db\2220\lnc\all\" -Recurse
Copy-Item -Path "File to copy 2.lnc" -Destination "C:\Program Files (x86)\Steam\steamapps\common\Game 2022\data\database\db\2220\lnc\all\" -Recurse
Copy-Item -Path "File to copy 1.lnc" -Destination "C:\Program Files (x86)\Steam\steamapps\common\Game 2022\data\database\db\2230\lnc\all\" -Recurse
Copy-Item -Path "File to copy 2.lnc" -Destination "C:\Program Files (x86)\Steam\steamapps\common\Game 2022\data\database\db\2230\lnc\all\" -Recurse
Copy-Item -Path "File to copy 1.lnc" -Destination "C:\Program Files (x86)\Steam\steamapps\common\Game 2022\data\database\db\2240\lnc\all\" -Recurse
Copy-Item -Path "File to copy 2.lnc" -Destination "C:\Program Files (x86)\Steam\steamapps\common\Game 2022\data\database\db\2240\lnc\all\" -Recurse
Can someone help me create 2 generic codes (I think one line for each copy) to copy the 2 files inside the "lnc\all" folders to any subfolder existing in the "db" folder?
That is, replace the 6 codes with 2 generic ones, in case there are other folders in the "db" it works too. Thanks.
I'm not a programmer, if possible send me the code in ready format (as an example, thanks)