Comment by shadowmint
13 years ago
I'm always found it difficult to read and impossible to debug.
It's useful, sure, but nice? I'm not convinced.
How about an empty recycle bin command? Why, certainly, you can do that:
$Shell = New-Object -ComObject Shell.Application
$RecBin = $Shell.Namespace(0xA)
$RecBin.Items() | %{Remove-Item $_.Path -Recurse -Confirm:$false}
Teh F33243ck. Readable much? I sure hope your powershell scripts come with comments; the one's we've inherited sure didn't and they're black magic.
That's because they don't have nice, human readable COM (and WMI) wrappers. I don't think they had time to implement them - they kept adding more and more from v1 to v2 and v3.
Every time you have Win32 spilling over in Powershell, it looks like crap (0xA).
I agree, Powershell is definitely uglier to look at. To shorten it a bit you could also do this..
Over here, on Linux-land, I used to have PS-envy whenever I thought about the PowerShell. You cured me!
Though I don't use Trash/Recycle myself, to contrast, I like the simplicity of
Commands like Remove-Item have familiar aliases like rm by default. If you see code in tools like Psake, etc. it would be very verbose, because the intention is to have readable code. But you sure can use the aliases for everyday use.
In GNOME: