ps1

Use WMI the Modern Way!

WMI is a powerful technique to find out information about local or remote computers, and you may have used Get-WmiObject before to do so (if not,...

read more

Using .NET Types Directly

Cmdlets contain pure .NET code, so thanks to cmdlets, you do not need to directly touch .NET code. You can, however. Here are a number of sample...

read more

Getting an Excuse

Here is a quick way of getting a good excuse - provided you have Internet access: #requires -Version 3 function Get-Excuse { $url =...

read more

Who Is Listening? (Part 1)

The good oldfashioned netstat.exe can tell you the ports that applications listen on. The result is plain-text, though. PowerShell can use regular...

read more

Sending Objects to Notepad

In a previous tip we showed how you can send text to a fresh Notepad instance. Today, you get an enhanced version of Out-Notepad: you can pipe...

read more

Send Text to Notepad

Notepad can be used to display text results. Typically, you would need to save text results to file, then have Notepad open that file. There is a...

read more

Magic Underscore Variable

Here is a very special (and very underdocumented) way to use PowerShell parameters. Have a look at this function: #requires -Version 2 function...

read more

Converting Currencies

PowerShell is an extremely powerful language and can access web services and web pages. If you combine that with dynamic parameters, you get a...

read more

Process Data (Part 3)

In parts 1 and 2, you learned how a PowerShell function can process information that was submitted to parameters or piped via the pipeline. In our...

read more

Process Data (Part 2)

In part 1 we showed how a PowerShell function can receive input both from a parameter and via the pipeline, and process it in real-time. This is the...

read more

Processing Data (Part 1)

This is the first of the three tips showing you how a PowerShell function can accept data via pipeline or parameter. In part 1, the function...

read more

Compressing to ZIP Files

In PowerShell 5.0, Compress-Archive can easily compress files and folders to a ZIP file: PS C:\> Compress-Archive -Path c:\sourcefolder...

read more

Validate Read-Host Input

Beginning in PowerShell 4.0, you can use validators for variable assignments. This gives you a quick and easy way of validating user input, too. The...

read more
1 53 54 55 56 57 128