Use XPath to Search XML Nodes by Node Text Value

Alright, another quick lesson in finding XML. You see, an XML node like this: <server name=”DomainController1″></server> Uses the name as an attribute. I just wrote a post about how to search XML by node attribute. But that won’t do you a...

Searching XML Nodes By Attribute Name with Select-XML

Any of you say this prayer after you’ve successfully remembered how to filter by the node attribute property with Select-XML and PowerShell? Dear God. Please let me remember this syntax the next time I’m trying to search an XML file. If you will just spare...

Using the Add Method of a Hashtable Object

I saw an interesting approach to working with a hashtable the other day. It started with this: $hashtable = @{} This is different than how I usually create an array: $array = @() And also different from creating a PowerShell object: $PSObject = [PSCustomObject]@{}...

Get a Folder Size with PowerShell

It’s really easy to get the size of a folder with PowerShell. Even though the directory does not actually have a property for size, you just need to get the size of all of the files inside the folder. function Get-FolderSize { [CmdletBinding()] Param (...