WMI is a fantastic source of information! Best of all, it works locally as well as remotely. For example, the next line gives you details about your...
posts-powershell
Filtering Events by Date and Time
As you have discovered in a previous tip, reading Eventlog entries is fairly simple using WMI and Win32_NTLogEvent: Get-WmiObject Win32_NTLogEvent...
Analyzing Event Logs
Event logs are a great source of information. The only problem is that they tend to be overwhelming. Try using WMI and the Win32_NTLogEvent class to...
Reading Text Files
Reading text files is easy using the Get-Content cmdlet: $text = Get-Content $env:windirwindowsupdate.log However, Get-Content reads the file line...
Converting ASCII and Characters
To convert the ASCII value to a character, use type casting like this: [char]65 To do the opposite and convert a character to its ascii value, use...
Checking File and Folder Permissions
Get-Acl is a convenient Cmdlet to expose NTFS file and folder settings. For example, to get a list of ownerships for a folder content, do this: Dir...
Sorting Text Files
You need to sort a text file, maybe a list of servers or names? Here is how: $file = $homeserverlist.txtGet-Content $file | Sort-Object |...
Playing a Song with Media Player
Windows Media Player can be accessed using COM, and WMP in turn gives you access to your entire media. Using GetByName(), you can directly access...
Listing Your Media Collection
Windows Media Player (WMP) gives you access to all of your media stored on your computer. PowerShell can access this information through COM using...
Cleaning Document Folders
Often, in your document folders a lot of files exist, and most of the time they are not really organized. With the help of a little PowerShell...
Advanced Compare-Object: Working with Results
By using the -passThru parameter, you can tell Compare-Object to return the actual objects you compared. Let's say you are looking for new...
Persisting Comparison Snapshots
Whenever you'd like to compare long-time results or compare data on different machines, you want to use persisted result sets. Persisted result...