Click here to Skip to main content
15,921,716 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: I can't help speculating... Pin
Johnny J.22-Feb-18 2:06
professionalJohnny J.22-Feb-18 2:06 
GeneralRe: I can't help speculating... Pin
lopatir22-Feb-18 4:18
lopatir22-Feb-18 4:18 
GeneralPauperShell Pin
Sander Rossel22-Feb-18 0:22
professionalSander Rossel22-Feb-18 0:22 
GeneralRe: PauperShell Pin
OriginalGriff22-Feb-18 0:31
mveOriginalGriff22-Feb-18 0:31 
GeneralRe: PauperShell Pin
PeejayAdams22-Feb-18 0:37
PeejayAdams22-Feb-18 0:37 
GeneralRe: PauperShell Pin
OriginalGriff22-Feb-18 0:41
mveOriginalGriff22-Feb-18 0:41 
GeneralRe: PauperShell Pin
PeejayAdams22-Feb-18 0:59
PeejayAdams22-Feb-18 0:59 
GeneralRe: PauperShell Pin
Sander Rossel22-Feb-18 0:59
professionalSander Rossel22-Feb-18 0:59 
If you put it like that it could make sense...
But I'd expect it to run multiple times and produce the same result.

The "fix" is amazing though.
if (Test-Path -Path "C:\TEMP\a") {
	if (Test-Path -Path "C:\TEMP\b") {	
		Copy-Item -Path "C:\TEMP\a\*" -Destination "C:\TEMP\b" -Recurse -Force
	} else {
		Copy-Item -Path "C:\TEMP\a" -Destination "C:\TEMP\b" -Recurse -Force
	}
}
Notice the \*, which produces the correct result, but only when the folder exists (if it doesn't you'll get an error because it can't copy nested folders) Unsure | :~
At least the two unexpected behaviors complement each other Laugh | :laugh:

GeneralRe: PauperShell Pin
OriginalGriff22-Feb-18 1:01
mveOriginalGriff22-Feb-18 1:01 
GeneralRe: PauperShell Pin
Sander Rossel22-Feb-18 1:04
professionalSander Rossel22-Feb-18 1:04 
GeneralRe: PauperShell Pin
DRHuff22-Feb-18 4:10
DRHuff22-Feb-18 4:10 
GeneralRe: PauperShell Pin
Richard Deeming22-Feb-18 1:00
mveRichard Deeming22-Feb-18 1:00 
GeneralRe: PauperShell Pin
Sander Rossel22-Feb-18 1:05
professionalSander Rossel22-Feb-18 1:05 
GeneralRe: PauperShell Pin
Kornfeld Eliyahu Peter22-Feb-18 7:36
professionalKornfeld Eliyahu Peter22-Feb-18 7:36 
GeneralFTFY Pin
Minion no. 525-Feb-18 2:16
Minion no. 525-Feb-18 2:16 
JokeStatistically... Pin
Johnny J.22-Feb-18 0:20
professionalJohnny J.22-Feb-18 0:20 
GeneralRe: Statistically... Pin
A_Griffin22-Feb-18 0:41
A_Griffin22-Feb-18 0:41 
GeneralRe: Statistically... Pin
Johnny J.22-Feb-18 0:47
professionalJohnny J.22-Feb-18 0:47 
GeneralRe: Statistically... Pin
CodeWraith22-Feb-18 2:45
CodeWraith22-Feb-18 2:45 
GeneralRe: Statistically... Pin
Johnny J.22-Feb-18 2:50
professionalJohnny J.22-Feb-18 2:50 
GeneralRe: Statistically... Pin
CodeWraith22-Feb-18 2:56
CodeWraith22-Feb-18 2:56 
GeneralRe: Statistically... Pin
DRHuff22-Feb-18 4:14
DRHuff22-Feb-18 4:14 
GeneralHow Long? Pin
The pompey21-Feb-18 23:40
The pompey21-Feb-18 23:40 
JokeRe: How Long? Pin
RickZeeland21-Feb-18 23:54
mveRickZeeland21-Feb-18 23:54 
GeneralRe: How Long? Pin
CodeWraith21-Feb-18 23:59
CodeWraith21-Feb-18 23:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.