There are plenty of free webservices around, and provided you have direct Internet access (no proxy), you can use New-WebServiceProxy to access...
Powershell
Using Safe Cmdlets Only
Let's assume you want to set up a restricted PowerShell v3 console that just provides access to Microsoft cmdlets with the verb Get. One way to...
Check Installed Server Roles and Features
Beginning with Server 2008 R2, there is a PowerShell module called ServerManager that you can use to manage server features and optional components....
Finding Published Printers
Finding printers that have been published in your Active Directory becomes trivial with Windows 8 or Server 2012. PS> Get-Printer -ComputerName...
Calculating Time Differences Using Custom Formats
Calculating time differences is easy - provided you can convert the date and time information into a DateTime type. If the date is in a custom...
Get CPU Load
To get the average total CPU load for your local system or a remote system, use Get-Counter. The example below returns the average total CPU load...
Calling WMI Methods with CIM Cmdlets
It can be very useful to call WMI methods, for example to create new shares, but in PowerShell v2 you had to know the names and exact order of...
Temporarily Activate High Performance Power Plan
It may be useful to automatically and temporarily switch to a "high performance" power plan from inside a script. Maybe you know that a...
Listing Power Plans
There is a somewhat hidden WMI namespace that holds WMI classes you can use to manage power plans. The code below lists all power plans on your...
Mixing DCOM and WSMan in WMI Queries
Using the new CIM cmdlets in PowerShell v3, you can run remote WMI queries against multiple computers using multiple remoting protocols. The sample...
New Operator -In
In PowerShell v3, you can use a new simplified syntax for Where-Object. Both lines below list all files in your Windows folder that are larger than...
Removing Leading "0" in IP Addresses
Leading "0" in IP addresses can cause confusion because many network commands interpret octets with leading "0" as octal...
CIM-Cmdlets Work Against Old Windows Boxes
The new CIM cmdlets require PowerShell v3, but you can still remotely target older boxes without PowerShell v3 or PowerShell at all. By default, CIM...
New WMI Cmdlets with DateTime Support
In PowerShell v3, to work with WMI you can still use the old WMI cmdlets like Get-WmiObject. There is a new set of CIM cmdlets, though, that pretty...
Finding Keyboard and Mouse
You can use WMI to quickly find all details about your mouse and keyboard: PS> Get-WmiObject win32_PointingDevice | Where-Object { $_.Description...
Finding Built-In Variables Part 2
In a previous tip we featured a piece of undocumented code that works in PowerShell v3 to list all built-in variables. Here is another approach that...
Adjust Text to Specific Length
If you must make sure that a text has a fixed length and is neither shorter nor longer, here is the code to pad and cut the text to the desired...
Finding Built-In Variables
Finding Built-In Variables...
Displaying MsgBox TopMost
In a previous tip you learned how to load additional .NET assemblies. This enables you to display dialog boxes like a MsgBox, pretty much like in...
Loading Additional Assemblies
When you want to load additional .NET assemblies to extend the types of object you can use, there are two ways of loading them: the direct .NET...
Using Open File Dialogs
To spice up your scripts, PowerShell can use the system open file dialog, so users could easily select files to open or to parse. Here's the...
Playing WAV files
PowerShell can play WAV files, so you can add sound and special effects to your scripts (provided your system has a sound card): PS> $player =...
Adding New Type Accelerators
To access popular .NET types faster, PowerShell maintains a list of shortcuts called "type accelerators". That's why you can use the...
Discovering Date and Time Culture Information
PowerShell automatically converts date and time information in various formats. If you'd like to know what formats are recognized by PowerShell,...