0
feel like I am going to laugh/Cry because I know that I am doing something stupid/obviously incorrect.
I am using SCCM and PSADT to attempt the below. It works fine if I UNC to the target folder and run the script but the below happens when deployed in SCCM
I have tried every variation of the below that I can think of. I am trying to move a directory from a networked VM to a local client but all I can seem to do is copy the EMPTY directory itself
examples of what I have tried are
If (!(Test-Path("C:\Target\"))) {
New-Item -ItemType directory -Path "C:\Target"
Copy-Item -Path "$dirFiles\Target\*" -Destination "C:\Target\" -Recurse -Force -Verbose
}
AND
If (!(Test-Path("C:\Target\"))) {
Copy-Item -Path "$dirFiles\Target" -Destination "C:\" -Recurse -Force -Verbose
}
And everything in between I can think of. Each time I just get the empty directory folder created but none of the contents
I brought the target up a level to "$dirTarget" and it worked. Is SCCM unable to go 2 levels down or should I always have had the script like that? – user001 – 2018-03-09T10:11:37.800
It's unclear what you're attempting "I am using SCCM and PSADT to attempt the below." and what your current code looks like. Currently your variable
$dirFiles
is undefined. – Seth – 2018-03-09T10:16:01.357It's part of a much larger toolkit which calls correctly for every other app. it defines the variables correctly (allowing me to access when running locally and on all other deployed Apps). I can see the folder being created in the destination directory but it is empty, the recursion is not taking – user001 – 2018-03-09T10:21:44.790