Typically, Out-GridView opens a window and displays whatever you pipe into the cmdlet: PS C:\> Get-Service | Out-GridView However, with a little...
ps1
Beer Challenge Results: Shortest Code for Password Analysis
At psconf.eu there was recently a challenge for the shortest code to check for how often a password was previously pwnd (hacked). Here is the result...
Geocoding: Sentiment Analysis (Part 5)
Some geocoding APIs provide sophisticated sentiment analysis like in the example below: "Most important museums of Amsterdam are located on the...
Geocoding: Text Scanning (Part 4)
Geocoding can automatically extract geolocations from text. This example also shows a new way of submitting information to a server: in the example...
Geocoding: Converting Lat/Long to Addresses (Part 3)
Today, we’d like to do the opposite and translate latitude and longitude into an address: '52.37799,9.75195' | ForEach-Object -Begin...
Geocoding: Converting Addresses to Lat/Long (Part 2)
Let’s start with translating addresses into latitude and longitude coordinates. We assume you read the previous parts to fully understand the...
Working with GeoCoding (Part 1)
Last year, Google changed their terms and requires an individual API key now to use their geocode API. Fortunately, there are free alternatives, so...
Using Session Variables in Web Requests
Sometimes, web requests that work fine in a browser do not seem to work well in PowerShell. For example, when you navigate to...
Left Side of Comparison
When using comparison operators, always make sure the relevant part is placed left. That’s because PowerShell looks at the left side of an...
Subscribe to Lock and Unlock Events
Whenever a user locks his machine, and whenever a user unlocks a machine, Windows emits an event. PowerShell can subscribe to these events and do...
Finding Installed Updates (Part 2)
The Windows Update Client maintains its own log of installed updates. Rather than querying the generic system event log, or actively searching for...
Finding Installed Updates (Part 1)
Get-Hotfix returns installed hotfixes but really only is a wrapper around the Win32_QuickFixEngineering WMI class. It is not returning all installed...
Finding Missing Updates
PowerShell can access the same logic that is used by the Windows Update Client, and query for missing updates: $UpdateSession = New-Object...
Who is Starting Hidden Programs?
Ever wondered why your CPU load is so high at times, or why black windows open up for a split second? Then check your event log for program...
Finding Logon Events
Provided you have Administrator privileges, here is a quick and easy way of dumping all login events. This way you can find out who logged in to a...
Resolving URLs
Often, URLs redirect to the final URL, so if you’d like to know where a given URL really points to, use a function like this: function...
Finding Size of Download
When you download files from the internet and use PowerShell, you may want to find out how long the download will take. While you can check the size...
Detecting Key Press
Sometimes it would be nice if a script was able to detect a key press without interfering with the script and its inputs. This way, you could add...
Using FileSystemWatcher Asynchronously
In the previous tip we looked at the FileSystemWatcher object and how it can monitor folders for changes. To not miss any changes, however, an...
Using FileSystemWatcher Synchronously
Here is a chunk of code illustrating how PowerShell can use the FileSystemWatcher to synchronously watch a folder including subfolders for file...
Using Default Credentials for Proxy
When your company uses an authenticated proxy, PowerShell may not always be able to contact the Internet. You may have to instruct the web proxy to...
PowerShell 7
Today we are not talking about code but about PowerShell in general. Microsoft has announced that the next release of PowerShell is called...
RSAT Tools Built-In
The Remote Server Administration Tools (RSAT) used to be an external download that added two important PowerShell modules: ActiveDirectory and...
Searching Files Using Index Search
Windows Indexing indexes most files in your user profile and drives the fast file search in File Explorer. PowerShell can access the same mechanism....