Trying to copy files to the temp directory and having issues

Basically nothing is working for me. In the help file it shows copy-file as the cmdlet to use but that doesn’t work. I get “The term ‘Copy-File’ is not recognized as the name of a cmdlet, function, script file, or operable program.”
Copy-File -Path “$dirSupportFiles\tax.exe” -Destination “c:\temp\tax.exe”

I’ve tried what someone else said to do in another thread and that doesn’t work. Well let me change that, if I run selection inside the script it works, but when I run using the deployapplication.exe, it fails.
$filecopypath=dir .\SupportFiles\tax.exe
Copy-Item $filecopypath -Destination “c:\temp\tax.exe”

I’m basically trying to copy 3 executables from the supportfiles folder to C:\temp and can’t get this to copy when running the deploy-application.exe

Does this work?

Copy-Item -Path "$dirSupportFiles\tax.exe" -Destination "C:\Temp" -Force


$dirSupportFiles should be script sourcing to that directory but for some reason it’s not for you. It works fine in my testing. Something with the scripting must have been corrupted. Download a new toolkit and retry.

1 Like

$dirSupportFiles only exists inside PSADT.

If you use PSADT’s Copy-File instead, you’ll get the results and errors mentioned in PSADT’s Log file.

@FoldZan1 thank you. I downloaded the most up to date version of the toolkit and it now works. Appreciate your help.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.