PowerTip: Capture the output of a Linux application in PowerShell

Summary: Use the built-in features of PowerShell to obtain data produced by a Linux application. Can I run a Linux application like ls and capture its output in PowerShell? You certainly can!  It’s no different from when you normally grab output from any other command in Windows.   To grab the output of the ls command,…


Open Source PowerShell – Part 4

Summary: Install and Configure SSH for Open Source PowerShell remoting. With PowerShell, up to this point, one thing that I love is the ability to connect various systems in my environment and run cmdlets on them remotely.  Can we do this with Open Source PowerShell?  Honorary Scripting Guy, Sean Kearney, is here today to go…


PowerTip: Return a status code to Linux from PowerShell

Summary: Pass a result code back to a calling Linux environment from Open Source PowerShell. How can I pass a numeric value back to a calling Bash Shell to indicate an error? Just simply supply the EXIT command and a numeric value at the point where the error is flagged. For example, the following code…


Open Source PowerShell – Part 3

Summary: Pass and return data correctly between Bash and Open Source PowerShell. Could you show me some examples of actually passing and returning values between PowerShell and Bash? Honorary Scripting Guy, Sean Kearney, is here today and we’ll do exactly that. It isn’t difficult to actually to do this either, but there are two things…


PowerTip: Get the status code of a PowerShell script in Bash

Summary: Identify the results of a script running in Open Source PowerShell in a Bash environment. Is there any way to see the results of a PowerShell script? For example, if somebody sent an “Exit 42”, could I see it in Linux? All you need to do is examine the $? variable in Linux, just…


Open Source PowerShell – Part 2

Summary: Use PowerShell scripts within Python and Bash (and those within PowerShell). I am curious just how much I can use Open Source PowerShell within Linux and macOS.  Is it an isolated environment, or can it interact with other shells? Thanks for your question.  Our good friend, Honorary Scripting Guy, Sean Kearney, is here today…


Manage SharePoint Online site collections and the web templates with PowerShell

Summary: PowerShell commands can manage site collections and the web templates that create site collections. Christopher Weaver is a Microsoft Premier Field Engineer (PFE) who focuses on SharePoint and Office 365 solutions for large enterprise Premier customers. He has been doing PowerShell and SharePoint with Microsoft for nine years. In his spare time, he enjoys backpacking, hiking,…


How to avoid reinventing the wheel in Azure Automation

Summary: Take advantage of existing scripts to create your own solutions.   Automation is the number one technical skill that IT needs to have to thrive in today’s quickly changing world. My recommendation is that anything you do for automation you should do in PowerShell, and you should use Azure Automation as your go-to automation…


PowerTip: Capture error code of a PowerShell session in Linux or macOS

Summary: Capture the status code of a PowerShell session in Linux or macOS. Could you show me how to run a PowerShell script in Linux or macOS and capture the status of whether that script succeeded or failed? No problem, my friend. Just run the PowerShell session, and start the script as in the following…