Live data from Hacker News

Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

news.softpedia.com

341–350 of 350 posts

Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

#341

Earlier quoted context omitted.

Yes, that is correct. Display mode: MODE CON[:] [COLS=c] [LINES=n]

Hey!!! This works in PowerShell (non-ISE)!!!! Breaks my 112 column limit, despite a default setting of 200. Added this to the end my Microsoft.PowerShell_profile.ps1 in my $HOME\Documents\WindowsPowerShell directory. (run: "notepad $PROFILE" in PS) MODE CON COLS=200 Clear-Host (I get some artifacts)

All functionality used to reside in conhost.exe, no matter which character mode application you used (command prompt or PowerShell), which is why a lot of commands would work for both character modes. This is not how things work now (though a lot of commands are still shared, like “mode 120,120”) as conhost.exe now just decides if it should give you the legacy console host or the new one (with things like buffer improvements and word wrapping).

There are a lot of subtle improvements I think many are not aware of, like, if you paste in text with smart quotes they will be changed to straight quotes.

Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

#343
post #201
post #197

Powershell is very insecure and is heavily abused by potential attackers as it's more flexible than CMD.exe. Of course, arguing about CMD.exe vs PS.exe is pointless, but it still needs to be argued. There has been a recent spate of talks in Blackhat conf. and other confs, about the versatility of PS.exe, how it is used to perform persistence in comparably little characters, or lines of script than CMD.exe Some of my…

I'm really confused here. What attack vectors apply to PowerShell, but not to a situation where I can invoke cmd.exe? I can tell PowerShell to only run signed scripts, and specify what signatures to honor, which is more than I can do with either cmd.exe or WSH. You're citing compactness of scripts, but a straight-up binary would be more compact still. I think I'm missing something pretty basic here.

> I think I'm missing something pretty basic here

I'm referring to something like Powersploit https://github.com/PowerShellMafia/PowerSploit/

Which is a post exploitation tool. Assuming you have a payload in Windows ready to execute, one typically wants to leverage tools already in Windows itself, like Powershell, which can make rootkits and other payloads have a lot less footprint, and make them difficult to spot using heuristics. Most crap payloads are actually easy to spot because their payload is massive.

Essentially my point is that you don't want to make it easy for attackers. For context, one would not want Powershell installed on 1000 Windows 10 installations.

I happen to get paid good money for deploying Win10 kiosks in different offices in my area and Powershell is one of many tools I routinely remove from Windows to decrease the attack surface in Win

Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

#344
post #301

Earlier quoted context omitted.

> ConEmu can even integrate stuff like Putty. If you're going to use ConEmu, just go ahead and use the straight & regular OpenSSH command-line ssh tool. Then you get all the standard niceties you can stash away for global reuse in ~/.ssh/config. I don't miss PuTTY one bit.

Ooh, could I use this to get ECDSA keys with configurable rounds of hash functions? I might switch from putty to ConEmu with OpenSSH then. Presuming I can get ConEmu's look close enough to my putty.

ConEmu is endlessly modifiable. You can inject dll hooks into it if you so wish even.

Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

#345

Earlier quoted context omitted.

You'll never get a drop down list in the host terminal windows has it doesn't have a GUI layer like that. Except you do, with PSReadline, built into Windows 10 PowerShell.

Sorry yes that's psreadline not posh-git like I commented. I wouldnt' call that a drop down though, that's just adding to the output isn't it? You know I've no idea how that works, could come in handy actually I should learn.

It's as close to a dropdown as you can get in the CLI without putting GUI elements over the top. Try

    gci -  then ctrl+space
The available parameters appear on the screen, you can select one with the arrow keys, and tab, when you choose one and press space, they all disappear again. It's interactive, dynamic, it changes depending on how much of the parameter name you've typed - it's not just printing to the screen and stuck there.

Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

#346

Earlier quoted context omitted.

Hey!!! This works in PowerShell (non-ISE)!!!! Breaks my 112 column limit, despite a default setting of 200. Added this to the end my Microsoft.PowerShell_profile.ps1 in my $HOME\Documents\WindowsPowerShell directory. (run: "notepad $PROFILE" in PS) MODE CON COLS=200 Clear-Host (I get some artifacts)

All functionality used to reside in conhost.exe, no matter which character mode application you used (command prompt or PowerShell), which is why a lot of commands would work for both character modes. This is not how things work now (though a lot of commands are still shared, like “mode 120,120”) as conhost.exe now just decides if it should give you the legacy console host or the new one (with things like buffer impr…

One of those subtle improvements is honoring a Ctrl-L. I like to be able to clear the screen like that.

Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

#347
post #302

Earlier quoted context omitted.

I don't think this is a good default for posh on nix platforms but I would argue that it's a good thing on Windows. The output of PowerShell ls is an object with typed properties and methods that you can interact with in a much richer way. Not to mention user experience. Adding these aliases made moving back-and-forth between nix and Windows much less jarring for me. They also really helped drive home the difference…

I don't really het the point of powershell making everything an object. If I wanted that I'd probably be in a python REPL.

I think if you'd asked me a few years ago I might have agreed. But the Python REPL is a terrible shell.

If you have a lot of experience with something like bash and you can run circles with it PowerShell probably doesn't add a lot of short term value.

Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

#348

Earlier quoted context omitted.

On a somewhat related note, one of PowerShell's biggest weaknesses is memory utilization. And since they make it so simple to pass around hefty object collections it tends to bite you in the ass early on. Particularly when you're using cmdlets. When doing real scripting that actually needs to be run as a job I am surprised when I can get away with cmdlets and don't need to manage .net APIs/objects directly. Especiall…

That is a good tip. There are certain product teams that produced ENORMOUS objects and your suggestion helps when dealing with that. Jeffrey Snover [MSFT]

Upon reading that again maybe I should have said it's weakness is that it's easy for everyone involved to create objects that use a lot of memory. I'm not sure it's fair to say PowerShell itself is bad at utilizing or managing memory. It's more of a possible negative side effect of one of its great strengths.

Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

#349
post #27

Btw did anyone noticed that in windows 10 you can resize cmd.exe to more than 80 characters width! When I first saw it I almost cried.

You could do it at least in Win7, maybe earlier, do not have anything older to test with. Click on icon (right click on top bar) --> properties --> layout. You can edit both window size and buffer size

Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

#350
post #16

Hopefully one day Bash will be the default Windows CLI.

That was the approach I took before inventing PowerShell. We didn't WANT to invent a shell - we were forced into it. The problem was that Bash on Windows wasn't effective. At the heart of the matter is the difference in architecture between Unix and Windows. In Unix, most everything is a file so if you can modify files and restart processes, you can manage everything. In Windows, most everything is an API so tools th…

I don't see PowerShell as a Bash replacement, I see Bash as more of a cmd replacement. I'm a user, but I'm also a developer so Bash works for my needs. PowerShell, not so much. It's powerful, no doubt, but it's not the solution I was looking for. Admins can always fire up PowerShell if they need it.

I didn't WANT to run Windows - I was forced into it.

Post reply on HN