-
I haven’t finished blogging about event 1 yet but this caught my eye. Things aren’t too bad until we hit the bunch of write-host calls $wrks = (Get-Content -path C:\IPList.txt) foreach ($wrk in $wrks) { $osver = Get-WMIObject...
-
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....
-
The object of the exercise in both the beginners and advanced sections of event 1 was to move a set of log files older than a give data to an archive folder. A number of solutions were presented that used robocopy. This is a workable solution that meets...
-
I’ve already blogged about incorrect use of backticks. Here is another example of un-necessary use of backticks $Files= Get-ChildItem ` -Path $Path ` -include...
-
One of the things we were asked to blog about as Scripting Games judges was things we liked and disliked. This code is a major dislike Get-ChildItem $sourceDirectory | ? {$_.PsISContainer } | % { $subDirectory = $_ ; Get-ChildItem...
-
Last week I presented a number of sessions at TechDays in beautiful San Francisco. Met some great people and had a great time. I presented 4 talks, almost all of them PowerShell-related. Actually, they all had some type of PowerShell content. I’m...
-
I keep seeing paramter constructs like this: [int]$age = '90' Why set the parameter to an integer and then set the default as a string. PowerShell will convert but it just doesn’t make sense. All you need is [int]$age = 90 Read More...
-
I am seeing an incredible number of scripts that have this sort of coding round parameters # Input from the user [Parameter(Mandatory=$false, ...
-
I don’t have the numbers to back this up but my feeling is that the Scripting Community is marking the entries for this years Games in a harsher manner than the judges did over the last few games. What will be very interesting is the level, type and usefulness...
-
At the moment it isn’t necessary to run your script to give a vote. Probably the quickest way to lose points is have an obvious and glaring error in your script such as . . . | where {$_.LastWriteTime –lt ( date ).ADDdays(-90)} | . . . or . . Read...
-
I’ve gone through most of the Beginner event submissions over the last couple of days. One thing that has jumped out is the potential misunderstanding around using the –include or –filter parameters on get-childitem. If we look at the...
-
Consider the file information from get-childitem PS> $file = ls servicesv0.6.txt Fullname gives the full path to the file PS> $file.Fullname C:\MyData\SkyDrive\Data\scripts\servicesv0.6.txt if you use DirectoryName you get the full...
-
Looking at my first group of entries for Beginners Event 1 I’ve noticed what seems like a fanatical attempt to squash everything onto one line. command; command; command; command is NOT a one liner. The ; marks the end of a line command |...
-
When my children were at school and going off for a test or exam the last thing I told them was read the question. It seems this needs to be repeated for the Scripting Games. The Beginners Event 1 involved MOVING files from one server to another...
-
The voting/judging process has started for event 1 in the 2013 Scripting Games. What I’m going to be doing over the next few weeks is point out some of the things that I’ve noticed when judging. Some will be good things that I think you should adopt;...