powertips

Formatting a DateTime

Whenever you have a true DateTime (and not a string, for example), you have plenty of powerful ways to format. You can get DateTime objects...

read more

Get Text File Encoding

Text files can be stored using different encodings, and to correctly reading them, you must specify the encoding. That’s why most cmdlets...

read more

Printing PDF Files (Part 2)

In the previous tip we explained how PowerShell can send PDF documents to the default PDF printer. This generic approach is OK for simple scenarios...

read more

Printing PDF Files (Part 1)

To automatically print PDF documents, unfortunately you cannot use Out-Printer. Out-Printer can only send pure text documents to a printer. However,...

read more

Scanning Ports

Here is a straightforward way to test ports on a local or remote system. You can even specify a timeout (in milliseconds): function Get-PortInfo {...

read more

Resetting Console Colors

It can be easy to mess up console colors in the PowerShell console. A single call with accidental values, or a script that messed with the colors,...

read more
1 17 18 19 20 21 122