but the script isn't running from the ccmcache folder.
What specifically "isn't running"? Do you get an error?
As Garth answered, you need to add logging and troubleshooting code to the script to determine what it's doing.
Start by adding a transcript.
Start-Transcript -path C:\Windows\Temp\MyScript.log
...... the rest of your script....
Stop-Transcript
Add in directory listings to see what files are there.
"Directory list of current directory"
get-childitem
"Directory list of script root"
get-childitem -Path $PSScriptRoot
Add in more Test-Path commands to verify that the files you expect to find are actually there.