ps1

When Add-Type Fails…

Add-Type can be used to load additional .NET assemblies from DLL files into PowerShell. This works well most of the time, and here is a sample call...

read more

Clearing All User Variables

In the previous tip we illustrated how you can identify built-in PowerShell variables with an approach like this: $ps = [PowerShell]::Create() $null...

read more

Finding PowerShell Classes

Starting in PowerShell 5, you can define PowerShell classes. They are defined dynamically and live in memory. So how would you know the names of...

read more

Using PowerShell Classes

Starting with PowerShell 5, you can define classes. They have many use cases. One would be to create libraries of useful helper functions to better...

read more

Greetings of the Day

Here is a simple approach that takes an array of strings and returns a random string that you could use for custom greetings in PowerShell:...

read more

Flush DNS Cache

Windows is using a DNS cache, so when you change DNS servers, you need to flush the cache before the new settings take effect. PowerShell is a...

read more

Displaying Folder Tree

PowerShell is a friend with old console commands, so the easiest way of displaying the tree structure of a folder is the old “tree”...

read more

Using Cached Port File

In the previous tip we explained how you can download port assignments via PowerShell from IANA. This process requires Internet access and can take...

read more
1 38 39 40 41 42 128