Powershell

Exploiting Your Command History

PowerShell “records” all your interactive command input to its command history, and Get-History shows them. If you played around with...

Testing Files and Folders (separately)

Test-Path is highly useful to test whether a file or folder exists, and it can be used with any of the PowerShell drives, so it can also test...

Getting Help for Cmdlet Parameters

There seems to be a bug in PowerShell 5.0 that limits the usefulness of the built-in help window. Whenever you run Get-Help with -ShowWindow, the...

Updating PowerShell Help with One-Liner

To get the most out of PowerShell, you should at least update PowerShell help once. This downloads and installs the base set of help files that show...

Downloading Pictures from Website

There are awesome websites out there, and one is www.metabene.de (at least for German visitors)-- on 33 pages, the artist presents his drawings for...

Check File Names for Illegal Characters

File names are quite sensitive and may not contain a number of reserved characters. To validate file names and make sure they are legal, here is a...

Finding Multiple Illegal Characters

Previously, we illustrated how to use the -match operator to find illegal characters in a text. The -match operator finds only the first match,...

Enabling CredSSP Trust from One Side

As previously shown, CredSSP can be used to remote code without double hop issues. To use CredSSP authentication, though, you need to make...

Finding Hidden Autostart Programs

Ever wondered why some programs launch whenever you log into Windows? Here’s a one liner listing autostarts that affect your login: #requires...

Translating SID to Username

Ever wanted to translate a security identifier (SID) to the real name? Here is a function helping you: #requires -Version 3.0 function...

Get GeoLocation of Computer

Here is yet another free source of geolocation information, exposing your current public IP and location information: #requires -Version 3.0...

Finding First and Last Day in Month

Did you ever need the first and last day in a given month? Here is a simple approach: # specify the date you want to examine # default is today...

Geolocating Your IP on a Map

As you have seen in previous tips, the Internet knows your IP address, and also where you are located. You can get the latitude and longitude of...

Finding Public IP Address

Would you like to know what your public IP address is that you are currently using while being connected to the Internet? It’s a one-liner:...

Finding Location of IP Address

Most IP addresses can be located using web services. Here is a very simple function that takes an IP address and returns information about its...

Finding IP Address Assigned by DHCP

Beginning with Windows 8 and Server 2012, operating systems ship with extensive PowerShell modules to manage server and client. They provide cmdlets...

Enum Week: Enums in PowerShell 5

Requires PowerShell 5 or better This week we are looking at enumerations: what they are, and how you can benefit from them. Beginning in PowerShell...

1 39 40 41 42 43 104