COPY-FILE questions

Topics: Archive - General
Jul 15, 2014 at 10:10 PM
I am attempting to copy a series of files and folders from the $dirFiles to $envProgramData\appdir (where appdir is the actual name of the destination directory created by the installer) and I can't seem to figure out the appropriate syntax. The Execute-MSI installed the application correctly and New-Shortcut worked to create the desktop shortcut but for the life of me I cannot figure out how to copy all of the required files and folders to the destination. One of the files also needs to overwrite a file that was created by the installer. If someone could provide some syntax suggestions. I tried several of the commands associated with Copy-Item such as force but that doesn't seem to work and threw an error. Oh and I did try a Execute-Process command that was something like this and it just stopped the install dead in its tracks with an error but there was no code to reference:

Execute-Process -FilePath "$envWinDir\system32\cmd.exe" -Arguments "/c xcopy $dirFile\Data*.* $envProgramData\appdir\ /e /s"
Jul 17, 2014 at 8:44 PM
can you paste what you've got for copy-file?