Powershell

Launching Windows Terminal for Any User

On Windows 10, there is a new and awesome tool available for any PowerShell user: Windows Terminal. It lets you use multiple PowerShell and other...

Permanently Deleting AD Objects

Many Active Directory objects are protected from deletion. When you try to delete them, you get an error, preventing you from accidentally removing...

Test-Driving New SSH Remoting

If you’d like to test-drive the new PowerShell remoting alternative that is using SSH instead of WinRM, make sure you install PowerShell 7...

Test Whether Applications Exist

Here is a simple one-liner that can test whether PowerShell 7 is installed on your system (or any other application): # name of application you want...

Converting File Paths to 8.3 (Part 2)

In the previous post we explained how you can use an old COM component to convert default long path names to short 8.3 path names. While...

Converting File Paths to 8.3 (Part 1)

Many years ago, file and folder names had a maximum of 8 characters, and these short path names still exist. They can even still be useful: short...

Using Online Help (Part 2)

In the previous tip we mentioned that many PowerShell users prefer the online help over locally downloaded help. To use the online help documents by...

Using Online Help (Part 1)

PowerShell supports both local help files and online resources. Take a look at the differences: # outputs help in same console window # level of...

Updating Help without Admin Privileges

In Windows PowerShell, updating help used to require Administrator privileges due to a design flaw: help had to be stored in the location where the...

Checking Profile Scripts (Part 2)

In the previous script we came up with a one-liner that checks which profile scripts actually exist. This solution works per host only, though,...

Checking Profile Scripts (Part 1)

PowerShell uses up to four profile scripts. When they exist, PowerShell silently executes any content when it launches. It’s important to know...

Using Profile Scripts

Profile scripts work like autostart scripts in PowerShell. They do not need to exist, but if they do, PowerShell executes its content silently...

Identifying User Profile

Be careful when using $env:userprofile or $home to create paths to user files. When a Windows box is set up for OneDrive, the documents folder may...

Get Rid of Get-EventLog

The Get-EventLog cmdlet provides easy access to event log entries in the primary Windows event logs, however it neither can access the many...

Setting and Clearing Trusted Hosts

PowerShell remoting maintains a list of trusted IP addresses and/or machine names on the client side (the machine that issues the command and...

Using $Is* Variables

In PowerShell 7, there is a new set of variables all starting with “Is”. They help you understand the environment in which your script...

Identifying Antivirus Engine State

In the previous tip you learned how you can query WMI to find out the antivirus product present on your Windows machine: $info = Get-CimInstance...

Deleting Microsoft Teams Cache Data

If you use Microsoft Teams for video conferencing, you may occasionally want to clean cache files and remove traces which reside in a number of...

Deleting Multiple Subfolders

Occasionally, it may become necessary to delete a set of subfolders within a given folder. Here is a simple chunk of code that deletes the folders...

Managing Autostarts

To manage auto starting programs on Windows, don’t bother writing extensive scripts. PowerShell can directly open the autostart manager...

Downloading Useful Scripts

The PowerShell Gallery not only offers public modules with new PowerShell commands but also public scripts. Before you invest time, you may want to...

Speeding Up PowerShell Remoting

PowerShell remoting is insanely powerful: with Invoke-Command, you can send arbitrary PowerShell code to one or many remote machines and execute it...

1 10 11 12 13 14 104