database-tools

Finding All Profiles with Desktop

This simple line dumps all paths to all desktops found in any of the local user profiles – just make sure you are running the line with...

Where-Object and .Where()

Beginning in PowerShell 4, you can use the Where() and Foreach() methods in place of Where-Object and ForEach-Object whenever you do not want to use...

Creating Object Arrays on the Fly

Here is a quick code sample that generates an array of objects using the built-in CSV parser: $csv = @' PC,Date PC82012,2017-02-28...

Exploring Type Accelerators

PowerShell uses a number of so-called type accelerators that help with long .NET type names. Instead of using...

Dangerous Temp Files!

Internal system functions are often helpful, but always make sure you fully understand what they do. A particularly popular system method is called...

Explore Objects

In PowerShell, anything is represented by objects, and here is a helpful one-liner that examines any object and copies its members as text into your...

Managing Bit Flags (Part 4)

In PowerShell 5, the new support for enums makes dealing with bit values much easier as you’ve seen in previous tips. Even setting or clearing...

Managing Bit Flags (Part 3)

Setting or clearing bit flags in a decimal is not particular hard but unintuitive. Here is a quick refresher showing how you can set and clear...

Managing Bit Flags (Part 2)

In the previous tip we illustrated how you can use PowerShell 5’s new enums to easily decipher bit flags, and even test for individual flags....

Managing Bit Flags (Part 1)

Occasionally, you might have to deal with bit flag values. Each bit in a number represents a certain setting, and your code might need to determine...

Working With Generics

Generic types can use placeholders for actual types, and you may be wondering why that can be exciting. There are a number of data types, for...

Show or Hide Windows

PowerShell can call internal Windows API functions, and in this example, we’d like to show how you can change the show state of an application...

Using Pester Tests to Test Anything

Pester is an open source module shipping with Windows 10 and Windows Server 2016, and can be downloaded from the PowerShell Gallery...

Setting Environment Variables

When setting environment variables through the PowerShell “env:” drive, you are always just manipulating the process set. It applies to...

Checking Host

In the past, Microsoft shipped two PowerShell hosts: the basic PowerShell console, and the more sophisticated PowerShell ISE. Some users used code...

Playing with PowerShell 6.0

PowerShell is open source now, and the next big release of PowerShell is being developed in the open. If you’d like to take a peek preview,...

Caching Credentials Using JSON

When you need to cache logon credentials to a file, this is typically done by piping the credential to Export-Clixml which produces a rather lengthy...

Free Guides to Start With PowerShell

If you have colleagues that don’t know PowerShell, and you would like them to get started, here are three free learning resources:...

1 72 73 74 75 76 159