[UPDATE: It’s Safe] CAUTION: Don’t Run Update-Help Right Now

UPDATE 2 JULY 2013: Microsoft is informing MVPs that the fix is in, and new help files should be downloadable by (at latest) the morning of 3 July 2013. So get your Update-Help ready to run. More info. If you haven’t recently run Update-Help… don’t. There’s a problem with the help files that have been produced recently so that instead of: -computername <string[]> You’re getting: -computername This affects all parameters – no value types will be shown. This has been reported to Microsoft, and they’ve acknowledged receipt of that report and are investigating. Personally, I believe the problem may be […]

Some notes on Event 2 Advanced

I hate to seem negative, but I’ve noticed a few things about a number of the advanced entries that seem like folks didn’t read the instructions, or just weren’t careful about details. There were a surprising number of entries that had [string]$ComputerName instead of [string[]]$ComputerName in the params section and then went on to treat the parameter as if it were an array. Somewhat related to the array issue, the problem statement indicated that there could be several files that had computer identification for piping into the solution. Several scripts went beyond the minimum by accepting a filename property to process […]

Scripting Games Week 2: Formatting edition

This time of the year always feels like someone is holding down the fast forward button.  I blinked and here we are Friday morning another week of scripts in the rear view.  I spent most of my week in the beginner class this week, and was greeted by a combination of beginners and scripters who weren’t quite ready to step up to advanced.  More of the latter if I’m to be honest.  This was a pleasant surprise as it’s another sign of the continuing growth of our community.  Now on to the scripts I knew when I signed up to […]

Notes on Beginner Event 2

 First of all, congratulations! It looks to me like a lot of learning is going on; the 2nd event entries look really good to me. I especially liked the way a number of you built up a one-liner by starting with a Get-WmiObject Win32_ComputerSystem -ComputerName (Get-Content file.txt) and piping it into Select-Object to generate the data. However, there were a couple of areas within the Select block that make me think that some more discussion of what $_ means in a pipeline would be helpful. Within the Select block, it is necessary to make a call to Get-WmiObject Win32_OperatingSystem to get […]

Don’s Event 2 Notes

I thought I’d mentioned this last time (tap tap, this thing on?), but maybe not: don’t format the output of your functions. The minute a function includes Format-*, you’ve trapped me into on-screen display, a text file or piece of paper modeled after the on-screen display, or not a lot of other choices. If I want formatting, I’ll pipe your function to my own Format-* command of choice. But if I want CSV, or HTML, or XML, I’d like that option. Thanks. This is not a favorite technique of mine: $ServerInfo = "" | Select-Object Name, SerialNumber, OS, Model, CPU, […]

Find Files with PowerShell 3.0

My last few articles have looked at using WMI and CIM_DATAFILE class to find files, primarily using Get-WmiObject in PowerShell. But now that we have PowerShell 3.0 at our disposal, we can use the new CIM cmdlets. So I took my most recent version of Get-CIMFile and revised it specifically to use Get-CimInstance. I also […]

Piping between functions

A question came up about piping between advanced functions. The input to the second function might be an array. To illustrate how this works imagine a function that gets disk information – or better still use this one. function get-mydisk{ … Continue reading

Account SIDs

A question on the forum asked about finding the accounts and SIDs on the local machine. function get-SID { param ( [string]$computername = $env:COMPUTERNAME ) Get-WmiObject -Class Win32_AccountSID -ComputerName $computername | foreach { $da = (($_.Element).Split(“.”)[1]).Split(“,”) $sid = ($_.Setting -split … Continue reading