Monthly Archives: April 2013

Getting the folder name

Consider the file information from get-childitem PS> $file = ls servicesv0.6.txt   Fullname gives the full path to the file PS> $file.FullnameC:\MyData\SkyDrive\Data\scripts\servicesv0.6.txt   if you use DirectoryName you get the full path to the parent directory   PS> $file.DirectoryNameC:\MyData\SkyDrive\Data\scripts   … Continue reading

Posted in Powershell, Scripting Games | Leave a comment

Don’t go mad on a one liner

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 … Continue reading

Posted in Powershell, Scripting Games | 1 Comment

Read the Question

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 … Continue reading

Posted in Powershell, Scripting Games | Leave a comment

WMI vs CIM speed tests–the final round

As a final test I want to see what happened when I ran multiple commands against the remote machine. PS> 1..100 | foreach {Measure-Command -Expression{1..100 | foreach {Get-WmiObject -Class Win32_ComputerSystem -ComputerName W12SUS; Get-WmiObject -Class Win32_OperatingSystem -ComputerName W12SUS; Get-WmiObject -Class Win32_LogicalDisk … Continue reading

Posted in PowerShell and WMI, PowerShell V3 | Leave a comment

Backticks are baaaaaad; don’t do backticks

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 … Continue reading

Posted in Powershell, Scripting Games | 1 Comment

CIM vs WMI cmdlets-remote execution speed

Following on from my previous post we’ll look at how the two types of cmdlets compare for accessing remote machines. I used a similar format to the previous tests but was accessing a remote machine. First off was the WMI … Continue reading

Posted in PowerShell and WMI, PowerShell V3 | Leave a comment

AD Management in a Month of Lunches– chapter 9 in MEAP

The MEAP for AD Management in a Month of Lunches has been updated with the release of chapter 9 on managing group policies

Posted in Books, PowerShell and Active Directory | Leave a comment