|
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)
At least the two unexpected behaviors complement each other
|
|
|
|
|
Or just delete the target folder (if it exists) before you do the copy.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Not an option.
Files get added to that folder manually.
It's copy and replace, but never delete
|
|
|
|
|
Create b
Copy a/* to b?
Should work every time because recreating an existing folder won't actually do anything.
I'm pretty sure I would not like to live in a world in which I would never be offended.
I am absolutely certain I don't want to live in a world in which you would never be offended.
Freedom doesn't mean the absence of things you don't like.
Dave
|
|
|
|
|
Try adding the -Container parameter.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Doesn't change anything, I believe it's true by default.
|
|
|
|
|
It is all about history. Sense or no sense. Go back to DOS or UNIX documentation of copy and will find the same behavior there...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
Copy-Item -Path "C:\TEMP\a" -Destination "C:\TEMP\b\" -Recurse -Force
|
|
|
|
|
...Six out of seven dwarves are not happy!
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- Never argue with a fool. Onlookers may not be able to tell the difference. Mark Twain
|
|
|
|
|
..at least only one actually grumpy though.
...mind you,. I think they'd all have a right to feel a bit hard done by. If not for them, SW would probably be dead (eaten by a big bad wolf or something) - they house her for a year or so, and look after her in her slumber, and then she runs off with the first handsome prince that comes along and sexually assaults her in her sleep! Drawrfism, it is, and a lousy moral lesson.
|
|
|
|
|
A_Griffin wrote: then she runs off with the first handsome prince that comes along and sexually assaults her in her sleep!
Yeah, it thoroughly contradicts what all females normally claim: That the size is not important!
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- Never argue with a fool. Onlookers may not be able to tell the difference. Mark Twain
|
|
|
|
|
|
Now there's a movie I definitely need to.......... avoid!
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- Never argue with a fool. Onlookers may not be able to tell the difference. Mark Twain
|
|
|
|
|
I will send you a copy for your birthday.
I have lived with several Zen masters - all of them were cats.
|
|
|
|
|
I have that on a shirt!
I got into a little fender bender the other day. We both got out to look at the damage and the guy I ran into was so mad he practically had smoke coming out of his ears. But he was only 3 and half feet tall. We meet at the bumpers and survey the damage and he looks at me and says "I'm not happy" and
I said
"Well which one are you then?"
I'm pretty sure I would not like to live in a world in which I would never be offended.
I am absolutely certain I don't want to live in a world in which you would never be offended.
Freedom doesn't mean the absence of things you don't like.
Dave
|
|
|
|
|
Till the CCC gets posted?
|
|
|
|
|
|
Did I hear 'chaos'?
I have lived with several Zen masters - all of them were cats.
|
|
|
|
|
Yeah - it's that sodding butterfly again.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Looks like I've started YOTL (yet another tag line).
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
|
Concerning new CP style
Before in the main menu it was:
quick answers
----Ask a question
----View all questions
----View unanswered questions
Now it is:
quick answers
----Ask a question
----View unanswered questions
To view all questions one has (simply) to press to the top menu "quick answers". From my Point of view not very intuitiv and uncommon how a menu should work.
Am I the only one who feels like this?
It does not solve my Problem, but it answers my question
modified 19-Jan-21 21:04pm.
|
|
|
|
|
Yep
But what I find not intuitive is that by default the 'Active' questions are shown, not the 'New' questions.
Made a lot of comments on outdated questions in the beginning ...
|
|
|
|
|
Nope , see here: Bugs and Suggestions
It does not solve my Problem, but it answers my question
modified 19-Jan-21 21:04pm.
|
|
|
|
|
The filter options have gone as well. I used to view the questions on the filters, and then use the all questions to see the rest as people don't always tag appropriately. Now it seems to take the filters from my list of tags in the "interested in" field and I have no way of viewing all questions without clearing that field.
|
|
|
|