-
I saw a little discussion thread on Twitter this morning which I felt needed a little more room to explain. Plus since we’re in ScriptingGames season beginners might like a few pointers. I always talk about PowerShell, objects and the pipeline....
-
Last week I posted an advanced PowerShell function to rename a hashtable key. As usual, the more I worked with it the more I realized it was missing something – namely the ability the take a pipelined object. My original version assumed you had...
-
Last week I came across a blog post that had a decent example using PowerShell and PowerCLI to get the disk location for all virtual machines. The posted code works and does display the information you might be after. $myVMs … Continue reading →...
-
There’s a relatively useful suggestion floating around on Twitter on how to save results of PowerShell command to a variable and see the results at the same time. PS C:\> ($data=get-process) I’ll admit this is a clever technique: you get...
-
One of the aspects of the Monad Manifesto was its advocating building GUIs on top of PowerShell. For some devs and fewer IT Pros, the mechanism is pretty clear and straightforward. But for a lot, it’s a bit of a black art. In this article, I’ll look at...
-
Earlier this week on Google Plus, Hal Rottenberg posted a PowerShell idea he had. His goal was to identify a group of objects that would be statistically significant. For example, given a collection of files, group the files by size … Continue reading...
-
I’ve been chipping in on a forum post about finding if a given file exists in any folder within the system environmental %PATH% variable using Windows PowerShell. There are several ways you might approach this. But the best way in …... [[...
-
Recently I responded to an email from a student seeking clarification about the difference between ByValue and ByProperty when it comes to parameter binding. This is what makes pipelined expressions work in Windows PowerShell. When you look at cmdlet...
-
I am moderator for one of our Ask-the-Experts forums , and every once in a while, I get questions I would like to discuss. Like this one: "I am tring to write a quick interactive command that will rename all the jpgs in the current directory and came up with the following command: $i=1; gci | ?...
-
Summary : Microsoft Windows PowerShell MVP, Don Jones, shows how to use the pipeline to create robust reusable functions. Microsoft Scripting Guy, Ed Wilson, is here. Our guest blogger today is Don Jones. Don Jones is a Windows PowerShell MVP Award recipient...
-
Summary: Learn how to create a Windows PowerShell function to implement dynamic method invocation. Hey, Scripting Guy! What can you tell me about dynamic method invocation? -- PG Hello PG, Microsoft Scripting Guy Ed Wilson here. Today is day 2 of guest...
-
Every now and then, users come up with questions like this one: "Why is Get-Content so slow? Reading in large text files can take forever!" This is a typical observation, and it illustrates a more general underlying problem: "Why is PowerShell sometimes so slow?". Easy answer: it...
-
Check out our new series about writing functions with style! In part 1, you learn how to write functions that actually emit their results as true objects, so other functions and cmdlets can pick up the results and further process them: http://powershell.com/cs/blogs/tobias/archive/2010/09/22/creating...
-
In part 1 of this series (Part 1) you learned a lot about creating functions that return results as real objects. You also created a function called Get-Shortcut which manages shortcuts in your start menu. As promised, today I'll show you how to use that function to manage shortcuts, add or remote...
-
Microsoft Scripting Guy Ed Wilson here. The sounds outside seems amplified by the inky darkness that grudgingly gives way to the early morning sun. I am sitting on the front porch sipping a cup of English Breakfast Tea, munching on a freshly baked cinnamon...