Are you tired of OneDrive icons polluting your file explorer tree view? If you don’t use OneDrive, then here are two handy functions that hide...
posts-powershell
Turn a Windows Server into a Workstation
PowerShell 5 and later releases come with a cmdlet to automatically add new Windows features, so if you are running a Windows Server and would like...
Automatically Printing to XPS Files
XPS is a document format similar to PDF from Microsoft. Although it never really was used in a large scale, it can still be a valuable internal...
Removing BOM from the Unicode Files
BOM (Byte Order Mask) is a characteristic byte sequence used in some Unicode encoded text files. If you receive text files with BOM that need to be...
PowerShell Cheat Sheet Compilation (Part 2)
In the previous tip we pointed you to a great compilation of PowerShell cheat sheets. Let’s now check out how easily PowerShell can download...
PowerShell Cheat Sheet Compilation (Part 1)
Here is a great compilation of popular PowerShell cheat sheets, completely free and ready for download:...
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...
Controlling PowerShell Transparency with Mouse Wheel
On Windows 10, when you hold CTRL+SHIFT and then move your mouse wheel, you can easily control the transparency of console window, including the...
Retrieving Windows Product Key
Here is a one-liner that retrieves your original Windows product key: (Get-WmiObject -Class...
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...
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,...
Installing Linux on Windows 10
Windows 10 comes with Windows Subsystem for Linux (WSL) feature that you can use to run various Linux distributions. Launch a PowerShell with...
Using Localized User and Group Names
[System.Security.Principal.SecurityIdentifier _i="0" _address="0" theme_builder_area="post_content" /][System.Security.Principal.NTAccount _i="1"...
SID of Current User
Here is a one-liner that returns the SID for the current user and can be used in logon scripts, for example:...
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 {...
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,...
Solving SSL Connection Problems
Sometimes when you try to access web services (or download internet content in general), PowerShell may bail out and complain about not being able...
Deleting the Oldest Log File
Enable Real-Time Streaming with Foreach
Classic foreach loops are the fastest loop available but they come with a severe limitation. Foreach loops do not support streaming. You need to...
Listing Network Drives
There are many ways to create a list of network drives. One involves a COM interface that was used by VBScript as well, and we’ll pick it to...
Sending Emails via Outlook
You can always use Send-MailMessage to send a mail via any SMTP server. If you’d like to use your Outlook client, though, i.e. to keep access...
Title-Casing Strings (Capital Letter Starts Each Word)
Polishing raw text is not always trivial, and when you’d like to make sure names or texts are well-formed, and each word starts with a capital...
Concatenating Text Files
Finding Windows Universal Unique Identifier (UUID)
Every Windows installation has a unique UUID that you can use to distinguish machines. While computer names can change, the UUID won’t: PS>...