Earlier quoted context omitted.
I just wrote batch files that serve as aliases for those. I type ls in my command shell and it does a dir /w behind the scenes, which makes it look more like how it looks in Linux anyway. Here are the ones I have: * cat.bat: type %1 * clear.bat: cls * diff.bat: fc /n /w %1 %2 * ls.bat: dir /w %1% * pwd.bat: cd * touch.bat: echo . >> %1 * top.bat: tasklist All have an @echo off at the top too. Touch is a little janky,…
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.
Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build
191–200 of 350 posts
Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build
#192Why ? Because some linux zealots think it's the best option ? Laughable.
Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build
#193Btw 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.
Most Windows terminal people use ConEmu rather than the inbuilt terminal apps - it's like iTerm2 vs Terminal.app on MacOS. ConEmu adds Unix style cut and paste, tabs, etc. Add openssh, PSReadLine and PSCX and you've got a proper terminal setup. Also MS should really improve the inbuilt apps to do this stuff.
Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build
#194That'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...
Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build
#195I'm probably wrong, but can you not type "ps" into CMD and get the PowerShell prompt? If so, can you do it the other way around as well?
you can run "powershell" from a CMD prompt and "cmd" from a powershell prompt. You can also nest prompts to switch context between them.
Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build
#196That'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.
One performance tip I picked up early on: If you're passing around large object sets you need to operate on try to keep them in a pipeline. Populating a variable and interacting with it is arguably more readable and maintainable, especially for junior people, but it has a heavy cost in terms of memory.
That said every version of posh is better than the last so I may be wrong or overestimating the impact for the newest versions. YMMV, don't believe everything you read on the internet, etc.
Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build
#197There 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 Win10 deployments even contain a script which silently disables PS.exe in the installation, and removes every reference to that executable in the registry. There are a few cases where I caught PS.exe re-spawning itself when a Win10 update arrives, so a PS-free deployment is hard to enforce.
Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build
#198Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build
#199Earlier quoted context omitted.
That is correct. Most people do not notice because the buildings in bash are almost completely equivalent to the standalone binaries.
I've only ever really noticed with 'time' and 'echo'
Re: Microsoft Replaces Command Prompt with PowerShell in Latest Windows 10 Build
#200Have to re-write all of them?