Kitz ADSL Broadband Information
adsl spacer  
Support this site
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
   Glossary   Glossary
 
Please login or register.

Login with username, password and session length
Advanced search  

News:

Author Topic: Powershell?  (Read 548 times)

bob.gas

  • Reg Member
  • ***
  • Posts: 120
Powershell?
« on: December 09, 2018, 05:23:47 PM »

Could anyone explain to a dummy..........

What exactly is Powershell, and what it's used for please? :blush:
Logged
Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes

chenks

  • Reg Member
  • ***
  • Posts: 686
Re: Powershell?
« Reply #1 on: December 09, 2018, 05:25:34 PM »

Logged

Weaver

  • Addicted Kitizen
  • *****
  • Posts: 7537
  • Retd sw dev; A&A; 4 × 7km ADSL2; IPv6; Firebrick
Re: Powershell?
« Reply #2 on: December 09, 2018, 08:36:33 PM »

It’s a programming language. One of a type of language called scripting languages. It’s designed for quickly knocking up programs for systems administration tasks or automating things you have to do from time to time, but you can also write very complex things in it as it’s powerful. Like other ‘shell scripting’ languages or batch programming languages it’s also aimed at the systems admin who wants to just issue commands on the fly, commands that can be very sophisticated.

Microsoft had a crude language called MS-DOS batch, this was upgraded quite a bit in the CMD program for the Windows NT family. One attraction of Unix and look-alikes as always been the various powerful shell programming languages and scripting languages that are available, and the shell scripting languages sh and bash have been popular and successful because of their power, wide range of capabilities and tight system integration in important areas.

In the past the shell scripting languages mentioned here have used a powerful but potentially flaky system of enabling communications between programs, where the text output produced by one program is taken and fed as text input to another program. This is convenient but has numerous problems. Such output is sometimes designed for human eyes not for consumption by a program. In such a case the output has to be altered and stripped down by some code that adapts the text produced by the first program so that program that is going to receive the data can understand the text being passed to it. Sometimes this can be a real nightmare. If the designers change the appearance, layout or formatting of the text produced then the whole thing will fail because it is making assumptions about the exact format of the text produced. To try and avoid this, some programs produce extremely terse and very minimal output and the designers can never dare change it and can never upgrade for fear some other code will break because it relies on the exact format of the output. So between fragility, freezing, what went wrong was that the output of many programs was meant for humans’ eyeballs, not meant to be input to other programs.

Aside from this fragility and the pain caused by constantly having to write glue code to adapt the format of info presented in text format there are also the problems of having to find an encoding format for information so it can safely be presented in text form, only then to be converted back from text to some native data type.

Microsoft decided to develop a dramatically more powerful programming language. It had to be not just radically better as a programming language than their previous efforts, but they wanted a serious competitor which would do better than the Unix shell scripting languages and their textual ‘pipe’-based (so-called) conventional method of inter-program data interchange. So MS made Powershell use a ‘pipeline’ like that available in Unix, MS-DOS and in the Windows NT family, which connects the output of one function or program to another, but, in a radical first afaiaw, the pipeline does not pass text, it passes a series of ‘objects’ of any type you please, where the word object is as used in the programming sense (a collection of named pieces of information; a ‘struct’ in C). Because the results returned by any Powershell function is meant to be used by programs rather than being text admired by humans, there is no mucking about having to parse, filter or adapt text to get output data into the form you need to serves as decent input. Also because everything is an object, output values can hold several components, not just one thing, with no difficulty. And choosing encoding formats to convert things into text form is gone away.

Strongly recommended- do take a look at it.
Logged
 

anything