powertips

HTML Encoding Advanced

The static .NET method HtmlEncode does a good job encoding the usual character codes but fails with many special characters. To encode all...

read more

HTML Encoding

There is a static .NET method that you can use to HTML-encode text, for example if you want the text to display correctly in HTML output: PS>...

read more

Translating Error Records

Whenever PowerShell records an error, it wraps it in an Error Record object. Here is a function that takes such an error record and extracts the...

read more

Ejecting CD Drive

Here is a fun little function that uses WMI to eject your CD drive. It does so by first asking WMI for all CD drives. It then uses the explorer...

read more

Beware of Aliases

Can you spot what is wrong here? PS C:\> function r { "This never runs" } PS C:\> r function r { "This never runs" } PS C:\> When you run...

read more
1 36 37 38 39 40 122