What
is PowerShell?
PowerShell
is a new command shell and scripting language for Windows. It
is cool for a lot of reasons: The language is sane, especially when compared to
CMD. Scripts
and command line share a language.
Why
PowerShell:
- PowerShell is both a command-line shell and scripting language.
- PowerShell can interact with a dizzying number of technologies.
- PowerShell is object-based.
- PowerShell can help anyone working in the Microsoft ecosystem
- Microsoft is putting its full weight behind PowerShell.
How
we Use PowerShell?
PS1 file
PS1 files are a bunch of PowerShell command in which a command appears in different line. It is a simple text file in which extension must be .ps
PS1 file
PS1 files are a bunch of PowerShell command in which a command appears in different line. It is a simple text file in which extension must be .ps
Execution
permissions
As
we know it is a series of command so, it must be have some permission and
execution policy to prevent wrong commands. Also
you can set policy as per user request. There are four types of policies namely
Restricted, RemoteSigned, AllSigned, Unrestricted.
Running
a script
To
run the shell script you can go to the PS1 file path and type name of PS1 file
and press tab key to Execute.
Pipelining
Pipelining
means output of one command use as input to next command.
Variables
Store
the output of command we need a variable so we can declared variable also. To
declared variable use '$' Sign.
The
@ symbol
'@'
symbol is use for convert contains of list into an array. This
is useful for storing multiple values.
Split
Split
is used for splitting a string. Suppose we need to store a string into an array
in that case we use split function.
About Author:
Vishal Kudale is enthusiast .net developer who works as associate consultant with Systems Plus Pvt. Ltd. He in free time reads and write on various web technologies. He can be contacted at: vishal.kudale@spluspl.com
Really very useful coding stuff thanks Vishal for Sharing this
ReplyDeletem currently learning host configuration things, so if have anything related to it kindly push forward. BTW good article vishal, hopefully it will be usefull for all .... :)
ReplyDelete1. MS cmd is not that handy. I would prefer cygwin or mingw over powershell. Install cygwin and use the full power of shell.
ReplyDelete2. You can use pipeline, inline command execution(back ticks), input/output redirection and other powerful shell commands. Which are still lacking in cmd or powershell.
3. Looks like MS cmd is still catching up on these features. Going forward It would be great if MS implements rich feature set of shell.
Btwn Nice Article :)
Thanks for information..
Deletewill soon post about Cygwin.
Nice Article.
ReplyDeleteTesting tools online training
ReplyDeleteVM Ware online training
Windows server online training
Pega online training