TechTalkz.com Logo Ask the Experts!

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Operating Systems > Open Source & Linux

Windows PowerShell vs Linux bash Shell

Open Source & Linux

 
Reply
Thread Tools Display Modes
Unread 21-05-2013, 05:22 AM   #1
Advanced Member (250+)
Thread Starter
 
Join Date: Mar 2013
Posts: 442
Thanks: 5
Thanked 10 Times in 9 Posts
Mood: Amazed
Rep Power: 67 shan123 is on a distinguished road

Intel Nvidia

Windows Server Windows 7 Linux Mac OS


Windows PowerShell vs Linux bash Shell

Hi

I think both are scripting language. Please help me to find the major different between both.

Sponsored Links
shan123 is offline   Reply With Quote
Unread 23-05-2013, 06:34 AM   #2
Senior Member (500+)
 
Join Date: Mar 2013
Location: colachel
Posts: 513
Thanks: 4
Thanked 17 Times in 16 Posts
Mood: Cool
Rep Power: 76 sahabcse is on a distinguished road

Intel

Windows 7 Linux Mac OS


Re: Windows PowerShell vs Linux bash Shell

The main difference between the two, in my humble opinion, is that PowerShell is a nice (and powerful) addition to a Windows system, whereas the Shell is a fundamental component of Unix.
sahabcse is offline   Reply With Quote
Unread 23-05-2013, 11:05 AM   #3
Advanced Member (250+)
Thread Starter
 
Join Date: Mar 2013
Posts: 442
Thanks: 5
Thanked 10 Times in 9 Posts
Mood: Amazed
Rep Power: 67 shan123 is on a distinguished road

Intel Nvidia

Windows Server Windows 7 Linux Mac OS


Re: Windows PowerShell vs Linux bash Shell

Thanks. You have given about the basic different of both scripting language. Can you provide some more info about Windows PowerShell vs Linux bash Shell.
shan123 is offline   Reply With Quote
Unread 24-05-2013, 01:24 PM   #4
Senior Member (500+)
 
Join Date: Mar 2013
Location: colachel
Posts: 513
Thanks: 4
Thanked 17 Times in 16 Posts
Mood: Cool
Rep Power: 76 sahabcse is on a distinguished road

Intel

Windows 7 Linux Mac OS


Re: Windows PowerShell vs Linux bash Shell

Both Bash and the Windows Vista PowerShell include commands for navigating directories, managing files, and launching other programs. System administration is an important duty for the shell, and Bash and PowerShell are equipped to help manage systems from the command prompt. Whereas Bash typically relies on a combination of newer tools and classic Unix utilities, the PowerShell has its own set of command-line programs. Windows refers to PowerShell commands as cmdlets. The PowerShell cmdlet called Get-Process is a counterpart to ps, and the cmdlet Get-Content corresponds to less. PowerShell differs significantly from previous Windows command shells.
sahabcse is offline   Reply With Quote
Unread 15-06-2013, 08:10 PM   #5
Newbie
 
Join Date: Jun 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0 honeymonster is an unknown quantity at this point

Intel Nvidia

Windows 8 Linux


Re: Windows PowerShell vs Linux bash Shell

  • PowerShell is designed to run on the object-oriented Windows architecture using COM objects, .NET objects and WMI/CIM classes. Bash is designed to run on a Unix platform using primarily command-line tools and text files.
  • PowerShell uses object-oriented pipes, bash uses text/byte stream only pipes.
  • The PowerShell object pipes allow for in-memory objects to be piped without the need for serialization/deserialization. With bash the tools must serialize to text and deserialize from text at eact step in the pipeline.
  • Object pipes allow for filters and selections to be formulated using property syntax instead of tools referencing columns, field numbers etc.
  • Object pipes in PowerShell are strongly typed. Datetimes are handed over from one command to the next with out text serialization. In bash, text serialization is brittle and e.g. dates, numbers etc may be subject to different interpretation by commands depending on system locale.
  • PowerShell object-orientation allows for more terse commands concentrating a single purpose for each command, i.e. finding or producing objects and not offering control of output format. Output formatting in PowerShell is handled by separate commands (format cmdlets). Many commands in bash have extensive options for controlling output formatting, rarely coordinated between the commands.
  • PowerShell includes integrated remoting. Remote control in bash is handled using SSH.
  • PowerShell has been designed as a "hostable" engine - i.e. an application can host PowerShell and use it's scripting capabilities to manipulate/automate it's own in-memory objects. Several general and special purpose applications are using this. Visual Studio NuGet package manager, for instance, runs inside Visual Studio. Bash runs as a monolithic process, an application can *talk to* bash but not use it to manipulate objects of it's own process.
  • PowerShell commands (cmdlets), functions and scripts declare parameters and other properties which can be used by the shell to discover metadata about the commands. In bash, commands are "opaque" and no metadata can be gleaned from them.
  • PowerShell uses command metadata to automatically support completions and (in the ISE) even autosuggestions. Bash uses externally defined completions, i.e. completions only work for those commands for which metadata has been defined.
  • PowerShell uses command metadata to discover type information for parameters, validations etc. PowerShell performs validation and type coercion *prior* to invoking the command. This allows command authors to *declare* validations instead of *coding* them. In bash, validation metadata does not exist and types do not exist (everything is text). Bash always invokes the commands and leaves it to each command to perform validation.
  • PowerShell has a module concept allowing for self-contained and isolated modules to be distributed. bash does not have a module concept. In bash you will use script files/libraries instead of modules. Script libraries does not offer the same isolation (e.g. private global variables) as modules.
  • PowerShell has integrated risk management. Commands that may alter system state can be invoked with -WhatIf or -Confirm for simulated execution and confirmed execution, respectively. If you build a PowerShell script and invoke it with -WhatIf this "simulation" mode is set for the scope of the script as if every command was invoked with -WhatIf. Bash does not have shell-defined risk management. Individual commands may allow something similar to simulated or confirmed execution (it's rare).
  • PowerShell has resilient sessions, you can disconnect from a session and reconnect later or from another computer and continue with the same session, same variable state, same jobs etc. Bash does not have resilient sessions.
  • PowerShell has workflows: scripts that save their execution state regularly and can be suspended and resumed, even across system restarts. When the script is resumed that state of every variable is restored and the script continues as if it was never suspended, *even* on another machine. Bash scripts cannot automatically save their state to a durable medium and cannot continue if they were stopped or killed.
  • PowerShell scripts can branch out and execute in parallel. Bash scripts cannot branch out. Bash can use an external command such as GNU parallel to execute commands in parallel; but it cannot execute *the script* in parallel.

Obviously these are just some of the most important differences.
honeymonster is offline   Reply With Quote
Unread 17-06-2013, 01:24 PM   #6
Advanced Member (250+)
Thread Starter
 
Join Date: Mar 2013
Posts: 442
Thanks: 5
Thanked 10 Times in 9 Posts
Mood: Amazed
Rep Power: 67 shan123 is on a distinguished road

Intel Nvidia

Windows Server Windows 7 Linux Mac OS


Re: Windows PowerShell vs Linux bash Shell

Sponsored Links
Thanks lot for sharing detail explanation, can you give me some example programs for testing out

Sponsored Links
shan123 is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
BASH SHELL : colors & watch command DeM Zed Unix 5 20-11-2007 06:16 AM
bash shell -- how to get it to add the current directory to my path Grande News Unix 1 08-10-2007 11:07 PM
[gnu.bash.bug] BASH Frequently-Asked Questions (FAQ version 3.35) Chet Ramey Unix 0 15-09-2007 05:38 AM
Introducing PowerShell (MSH) - Windows answers to linux shell? Pavs 2007 Windows Server 2003 0 28-08-2007 04:39 AM
Introducing PowerShell (MSH) - Windows answers to linux shell? Pavs 2007 Windows Server 2003 0 28-08-2007 04:39 AM


< Home - Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT. The time now is 02:21 PM.


vBulletin, Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © 2005-2016, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional