Q&A

PipeScript: Transforming How We PowerShell

Get the scoop on a powerful PowerShell automation tool, which has the ability to transform the way we code.

PowerShell automation to make the lives of IT easier is what it's all about for James Brundage, founder of Start-Automating. That's what compelled him and his team to create the PipeScript module, which looks to simplify and drastically speed up the code writing process through automation.

Now it's time to spread the word, and help cut the coding time and costs of IT pros. Ahead of his TechMentor session, titled "Game Changing PowerShell," Brundage is here to break down why you should be using PipeScript and how it will change how we interact with PowerShell.

And go deeper into this powerful module by learning the ins and outs during Brundage's session during this year's TechMentor, taking place in Redmond, Wash. from July 17-21.

Redmond: How is the PipeScript module a "game changer" for PowerShell users?
Brundage: PipeScript changes the PowerShell game in a few important ways:

  • It allows us to build our PowerShell scripts, exposing some errors before they happen.
  • It expands the PowerShell language, letting everyone do much more with less code.
  • It lets us template over 45 other languages with PowerShell/PipeScript (making your PowerShell knowledge much more valuable).

What is an example of a common use case for PipeScript that will make IT's life easier?
Building more with less. Being able to produce complex PowerShell code without knowing all the tricks of the trade can make a developer much more productive.

A very common use case is command inheritance. By inheriting an existing command, one can easily extend existing commands and customize them for your environment and scenarios.

Another incredibly useful scenario is constructing scripts from metadata. It's possible to quickly and easily turn a JSON schema into a function, and you can easily hand craft an integration with any data source to build very complex modules with very little code.

What common mistakes can users fall into when not correctly utilizing PipeScript?
PipeScript is meant to be used to build your files. Running it interactively will work and will be less efficient.

Inside the Session

What: Game Changing PowerShell

When: July 19, 8:00-9:15 a.m.

Who: James Brundage, Founder of Start-Automating

Why: " Being able to produce complex PowerShell code without knowing all the tricks of the trade can make a developer much more productive."

Find out more about TechMentor, taking place July 17-21 in Redmond, Wash.

Also, because PipeScript builds files, you must debug the transpiled script.

What's your top tip for those new to PipeScript to get up and running with the module? 

Get-Help is your friend. If you're curious about how things work, try getting help about the topic at hand. Pay special attention to the examples.

If you want to see it in action, look at repositories that depend on PipeScript, and see how they use it to great effect.

Two good examples are PSSVG (around 700 lines of PipeScript becomes  around3,000,000 lines of PowerShell) and obs-powershell (14kb of PipeScript becomes 543kb of PowerShell).

Failing that, please, share any difficulties you encounter with a GitHub issue or discussion. We want to grow the language for the benefit of all and we want it to be easy and will happily help you understand.

What is your dream tweak or feature you would like to see added to a future version of PipeScript?
This is a little question with a few big answers that are being actively worked on.

We're currently working towards:

  • enhancing natural language processing in PipeScript
  • translation from PowerShell/PipeScript into other languages
  • integration of AI generated code

For a bit of background on the natural language capability built into PipeScript, check out this post: Commands could be read as sentences | PipeScript (start-automating.com).

We're working on making sentence functions simple to construct, so that you any sentence you could write could be parsed and executed (AI not required). This should hopefully be complete this month.

Next up on the agenda is allowing PowerShell classes to be translated into other .NET languages, so your PowerShell can become C#. In the same timeframe as we do this, we should be able to say implement code in simple sentences. That is to say, by June:

Implement ICollection In C#

Should be a valid sentence in PipeScript, and should do what is in the tin, implementing ICollection in C# (even if you never wrote a line of CSharp in your life). This should also be completed this month. So should:

Class  MyClass { 
….
} in CSharp

Last, but not least, we intend to integrate support for building code with sections of any size implemented by AI in any engine. A buzzwordy way to put this would be "Copilot in CI/CD" (though copilot is not the only planned method of implementing this feature).

PipeScript itself is something of a "dream tweak" to PowerShell, as it lets us extend and reshape the language in any ways we need or see fit.

A great analogy here is PipeScript is to PowerShell what TypeScript is to JavaScript.

TypeScript drastically improved the capabilities of Javascript and the market value of skilled Javascripters.

We aim to do the same for every PowerShell scripter and programmer on the face of the planet.

About the Author

Chris Paoli (@ChrisPaoli5) is the associate editor for Converge360.

Featured

comments powered by Disqus

Subscribe on YouTube