Articles
PowerShell articles, tutorials, and guides from community experts.
Writing 10961A: The Damn Variables
When I wrote Microsoft course 10325A, their original 5-day Windows PowerShell course, I saved variables until Module 11. My thought at the time was to focus on teaching just what students needed for what they were about to do - and no more. “Just in time learning” can be effective, …
Select-String "“ finding the first and last matches
Today’s question concerns finding the first and last matches in a file Sometimes, I need to make two passes at seeking content in this file, once for the first occurrence; and a second grep for obtaining the last occurrence of a phrase. After the second pass, I figure placing the values into …
Workflow article 3
The next in the series of articles on PowerShell workflows that are appearing on the Scripting Guy blog has been published. The articles in the series that have been published are: http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx …
Select-String"“information on matching files
Following on from yesterday"™s post this is the second question: Since I’m recursively searching thru files to find matching phrases, how can I obtain other directory service information about the matching files file(s) – this is more of a methodology technique question because I realize …
3 Updated Free PowerShell eBooks in January 2013!
I’ve been working to update my three free PowerShell ebooks for this month: Secrets of PowerShell Remoting Creating HTML Reports in PowerShell Making Historical and Trend Reports in PowerShell The updated versions will be made available to subscribers of the PowerShell.org TechLetter on …
Select-String scenarios "“ fixed columns
I had some questions come in after mu recent post regarding select-string. I"™ll answer them as a series of posts. First off: I’m recursively searching thru many files, and want to pull out specific data in ‘fixed column’ positions from the line(s) that match the phrase …
PhillyPoSH 01/03/2013 meeting summary and presentation materials
User group member Greg Martin gave a presentation on Active Directory and PowerShell. A copy of his presentation can be found here and included the following topics: Building a copy of your production AD domain Notifying users of expiring passwords Dealing with expired computer accounts User group …
Select-String confusion
I have seen a lot of confusion recently over the use of Select-String. One mis-conception is that you need to use Get-Content to pipe the file contents into Select-String. Not so. Select-String will read the file for you. If you just want to scan the files in a single folder to find a specific …
Number of processors in a box
WMI enables you find the number of processors in your system: PS> Get-WmiObject -Class Win32_ComputerSystem | fl Number* NumberOfLogicalProcessors : 2 NumberOfProcessors : 1 This works fine for Windows Vista/Windows 2008 and above. Earlier versions of Windows mis-report the number of processors …
