Month: November 2012

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

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

Finding IP Address

There are various ways to determine the IP address that is assigned to your machine. Here is a rather unusual approach that uses text operators to...

read more