powershell - Copy-Item with over write -


In one of my scripts, it tries to copy an exe to the C: \ Windows \ Temp folder. For example:

  copy-item repo \ filename.exe -nation \\ $ machine_name \ c $ \ windows \ temp   

error message: < / P>

  copy-item: network path was not found D: \ CMPortal \ Scripts \ ClientRepair \ RepairCCMClient.ps1: 122 char: 33 + If (copy-item   

When I run the same command manually, it works. Do not know what is wrong if there is a copy file in the file then what is there to overwrite the file?

Thanks in advance.

Are you using quotes correctly?

  copy-item 'repo filename. Exe '- Destination "\\ $ machine_name \ c` $ \ Windows \ Temp" - Force    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -