powertips

Kindergarten-Mode

To protect you from damages while playing with PowerShell on a productive system, set the ”WhatIf” mode as default:...

read more

Combining Objects

Sometimes it becomes necessary to consolidate two or more objects into one. So, how would you combine object properties into one object? In a...

read more

Logging Input Commands

If you'd like to maintain a log file with all the commands you entered interactively - in the PowerShell console as well as in the ISE editor -...

read more

Protecting Functions

To prevent a function to be redefined or overwritten, you can write-protect it: function Test-Function { 'Hello World!' } Set-Item -Path...

read more

Finding Built-In Cmdlets

In times where cmdlets can originate from all kinds of modules, it sometimes becomes important to find out which cmdlets are truly built into...

read more

Detecting STA-Mode

Here is a simple line that tells you whether PowerShell runs in MTA- or STA-mode: [Runspace]::DefaultRunspace.ApartmentState -eq 'STA' This...

read more
1 77 78 79 80 81 122