Hopefully, everyone knows by now that the default power plan in Windows 2008+ is “balanced” which can result in your CPUs being throttled down to...
posts
Using "Using:" On Remote PowerShell Sessions (Part 2)
In a previous tip we talked about using PowerShell Remoting to execute code on a remote machine, and how to use "using:" to carry over...
Using RegEx to Filter Files
Get-ChildItem supports basic wildcards, but it does not support the rich feature set of regular expressions. If you combine Get-ChildItem with...
Enable PowerShell Remoting in Two Lines of Code
One common problem with enabling PowerShell Remoting on your box is public networks. As long as there are active network connection labeled as...
Using "Using:" On Remote PowerShell Sessions
When you use PowerShell Remoting to execute scripts and commands on another machine, you may have run into an issue like this: $class =...
Replacing Variable Names in ISE 3.0 Editor
If you want to replace variables in a PowerShell script, in PowerShell ISE 3.0 you can use the following function: function Replace-Variable {...
Quick Reference Sheets for PowerShell
PowershellMagazine.com has prepared a set of very useful quick reference sheets for PowerShell 3.0, the ISE editor and more. Microsoft now offers...
Controlling Admin PowerShell from Non-Elevated PowerShell
In a previous tip we illustrated how you can use Start-Process to launch an elevated PowerShell from within your script to do elevated tasks. The...
Reversing GUIDs
Active Directory and other services sometimes use a custom GUID format. To convert a GUID to that format, all blocks of the GUID need to be...
Preventing Direct Function Calls
If you must make sure that a function within your script is inaccessible from outside calls, you can use this trick. Save this code as a script...
Use Select-String For Fast Textfile Parsing
Select-String is an extremely useful cmdlet for parsing log files. You can use it to dump all lines in a text file that contain a certain keyword....
Replace Escape
There are two ways for replacing text, and both have their advantages and pitfalls: Each string has a Replace() method which works very...