Live data from Hacker News

Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build

news.softpedia.com

211–220 of 350 posts

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

#211

Earlier quoted context omitted.

Windows just failed on running my text file because it didn't have the correct header.

"is executable" is different from "is an executable". Your other comment was worded to say the former, while this one seems to refer to the latter. For example, a .jpg image can be marked as executable, but it is not an executable. This can happen on both Linux and Windows, and I believe it is handled by the filesystem. I supposed the term "marked as executable" could be used for this, while "is executable" could mea…

CreateProcess() doesn't care what the file extension is when you pass the executable filename into the lpApplicationName parameter.

I used this feature when I worked on a VR app written in Unity, and I had a little launcher program that checked for updates and then started the main program. I didn't want people to bypass the launcher, so I renamed the main program to have a .VR extension instead of .exe, preventing it from being run directly from File Explorer. The launcher had a .exe extension and could be run normally, and then it used CreateProcess to run the FooBar.VR executable.

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

#213
> Microsoft is expected to get rid of [Command Prompt] completely at some point in the future.

This is extremely unlikely to ever happen. As long as people have .cmd and .bat files they need to run, cmd.exe will still be around. They're not going to just remove it and break all those scripts.

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

#214
post #191
post #93

Earlier quoted context omitted.

copy nul %1 >nul to get an empty file. It's not a replacement for touch, though, as touch will do something different to existing files. Your attempt will silently overwrite the file in that case.

Couldn't you just append null to a given filepath to get the same result, or am I misguidedly assuming that >> creates files that don't exist?

Interesting idea, but type nul >> file doesn't change the metadata, perhaps because nothing was written. But yes, it would at least not destroy files.

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

#215
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.

I have been waiting for that for years - now if they would only add TABS to real powershell (as opposed to powershell ISE) or if they can add colors to powershell ISE I will be super-duper-bonus happy.

They have 24-bit colour support in the latest Insider build.

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

#216

Windows fan here. I hate PowerShell and I'd much rather have Bash built into Windows. Things I hate about PowerShell: - You can't even run your own scripts without performing the Set-ExecutionPolicy ceremony first or signing your scripts. - It's way too verbose. - It's a strange bird that next to nobody uses, so there's zero motivation to learn it. - It's not "old reliable". You can't depend on it working due to the…

Literally every windows admin uses it. It's the official commandline interface for microsoft software.

Every piece of microsoft software must provide a ps interface. It's an engineering directive.

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

#217
post #153
post #16

Hopefully one day Bash will be the default Windows CLI.

Bash has its warts too. Treating everything as strings can cause headaches when filenames have spaces. As a long-time Linux user who recently learned some powershell, I find Bash rather primitive after getting accustomed to an environment where everything is an object. I wonder how feasible it would be to build a powershell-like environment for Linux on top of Python.

There is Xonsh [0].

[0] http://xon.sh/

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

#218
post #176

That's nice. Can you pipe binary data without powershell corrupting it, or is that now a feature? https://brianreiter.org/2010/01/29/powershells-object-pipeli...

Related, running something like decrypt hugefile.dat | encode outfile.dat will usually result in powershell using up all your system ram and crashing.

Most likely because it loads it all into memory, rather than say streaming it.

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

#219

That's nice. Can you pipe binary data without powershell corrupting it, or is that now a feature? https://brianreiter.org/2010/01/29/powershells-object-pipeli...

Get-Content test.jpg -Encoding Byte -ReadCount 1000 | Set-Content test2.jpg -Encoding Byte

Piped binary data, not corrupted, since a long time before that blog post was written.

What you can't do is run native commands, and read their standard output as a byte stream without going through .Net and Start-Process.

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

#220

That's nice. Can you pipe binary data without powershell corrupting it, or is that now a feature? https://brianreiter.org/2010/01/29/powershells-object-pipeli...

Was super fun to learn about this when restoring the "backup" dumped via pipe in a powershell script.
Post reply on HN