|
Oh great! What did I get? Is it coming in the post?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
...Do you think the guy that coined the term "one hit wonder" ever came up with any other popular phrases? Or?
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
|
|
|
|
|
It does make a person wonder, doesn't it?
|
|
|
|
|
Yeah, at least once...
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
|
|
|
|
|
Johnny J. wrote: one hit Wonder One is really an hairy doughnut, hitting blind people. He should try with someone that can fight back.
GCS d-- s-/++ a- C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
den2k88 wrote: hitting blind people. He should try with someone that can fight back. Ever watched "Daredevil"?
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
|
|
|
|
|
Fake News, Stevie Wonder had more than 1 hit.
Signature ready for installation. Please Reboot now.
|
|
|
|
|
So I've got this really very simple PowerShell script:
Copy-Item -Path "C:\TEMP\a" -Destination "C:\TEMP\b" -Recurse -Force
The result... C:\TEMP\b is created and all items from a are copied to b, so far so good.
I run it again, exactly the same as before, except folder b does now exist.
The result... I get a new folder C:\TEMP\b\a with all contents of a.
In what universe is this expected logical behavior!?
|
|
|
|
|
Makes sense to me: the first one is making a copy of a folder in C:\TEMP, and calling the copy "b".
The second time, B exists, so it assumes you want to copy the folder a into it rather than mix the two up.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I'd rather expect a copy operation to be idempotent, it's something that can easily be run more than once unintentionally.
98.4% of statistics are made up on the spot.
|
|
|
|
|
I know what you mean, but it is two different operations. The first provides a new name for the copy, the second doesn't.
If you want the same behaviour, then delete the "target folder" as part of your script immediately before the copy operation.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I see where you're coming from but a shell command has two purposes in life - stand-alone and scripting. It shouldn't be optimised for one use over the other.
|
|
|
|
|
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
|
|
|
|