Roccat
asked on
path with wildcard
How can I use a wildcard in a path name? Java is always updating and I need to be able to copy files into the java security folder but I dont want to have to keep updating the path name for every version. How can I use a wildcard for a folder in the path.
The dirtory is C:\Program Files (x86)\Java\jre1.8.0_111\li b\security
Here is what I have tried.
copy-item c:\test.txt "C:\Program Files (x86)\Java\jre*\lib\securi ty"
The dirtory is C:\Program Files (x86)\Java\jre1.8.0_111\li
Here is what I have tried.
copy-item c:\test.txt "C:\Program Files (x86)\Java\jre*\lib\securi
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
In case anyone else is looking to do what I am doing this is it.
Get-ChildItem 'C:\Program Files (x86)\Java\jre*' -Directory | % {Copy-Item -Path 'local_policy.jar' -Destination "$($_.FullName)\lib\securi ty" -force}
Get-ChildItem 'C:\Program Files (x86)\Java\jre*' -Directory | % {Copy-Item -Path 'US_export_policy.jar' -Destination "$($_.FullName)\lib\securi ty" -force}
Get-ChildItem 'C:\Program Files (x86)\Java\jre*' -Directory | % {Copy-Item -Path 'local_policy.jar' -Destination "$($_.FullName)\lib\securi
Get-ChildItem 'C:\Program Files (x86)\Java\jre*' -Directory | % {Copy-Item -Path 'US_export_policy.jar' -Destination "$($_.FullName)\lib\securi
ASKER