Curly Blue and the meaning of scripting – Part 3

Summary: Curly Blue discovers the raw power of Cim-Instance combined with PowerShell remoting. We continue with Curly Blue as he searches understand the meaning of scripting. He is still sitting in the office with Azura. The co-op student, Hermie, has run off to chase something that wandered into his phone. Virus or virtual creature, nobody…


PowerTip: List locked-out accounts in Active Directory with PowerShell

Summary: Use Active Directory cmdlets to identify locked-out user accounts and computer accounts. Is there a quick and easy way to find all users who are locked out in Active Directory by using PowerShell?   You’ll love this. The answer is just one cmdlet away with the ActiveDirectory module. Just use Search-ADAccount, and you’ll have…


Curly Blue and the meaning of scripting – Part 2

Summary: Curly Blue learns how to use built-in PowerShell script examples in Windows. Yesterday we met our new friends, Curly Blue and Linux. Curly had started his new job as a IT Professional at Contoso. The challenge for poor Curly was that he had never learned scripting or, for that matter, gotten into the spirit…


PowerTip: Limit Get-Childitem to a limited depth in the tree

Summary: Use the new -depth parameter to control how far down a directory you can search. I have a large file structure to search but I only want to go two folders deep on the search.  Is there a way to do this in PowerShell? Certainly!  In PowerShell 5.0, you can use the -depth parameter…


Curly Blue and the meaning of scripting – Part 1

Summary: Curly Blue learns how to automate cleaning of old data files by using PowerShell. This week, in the spirit of the holidays (and of course the previous six years!), Hey, Scripting Guy is honored to bring forth a repeat of a tradition: The “Hey, Scripting Guy!” holiday special. This year, we are pleased to…


Make Visual Studio Code more like the integrated scripting environment

Summary: Learn some handy tips to make Visual Studio Code work more like the ISE. I was very intrigued with the release of Visual Studio Code last year. An editor that is light-weight and integrated with Git is something worth considering. Well, any new tool that could be added to the tool box is worth…


Get started with PowerShell development in Visual Studio Code

Summary: Learn about the features in Visual Studio Code that help you write PowerShell code. Since the PowerShell integrated scripting environment (ISE) shipped with Windows PowerShell 2.0 in 2009, the PowerShell landscape has changed significantly. In November 2014, Microsoft took .NET open source and cross-platform. Given PowerShell’s dependence on .NET, this was an important prerequisite…


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…