Getting the ASCII/ UTF-8 value of a string
To display the character associated with an ASCII/ UTF-8 code do the following:PS> [char]97 aThanks to this PowerTip.Now how about the reverse? Can I get the ASCII/ UTF-8 code of a character.PS>...
View ArticleObfuscate email addresses with PowerShell
Came across the following piece of code in someone’s signature today.[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775...
View ArticleGet a list of partitions and free space
The Win32_Volume class can be used to list partitions. The default output is very verbose but properties of interest to me are DriveLetter, Label, Capacity, and FreeSpace.PS C:> gwmi Win32_Volume |...
View ArticleFormat-Table FormatString
In the previous post I wanted to convert some output to percentage figures and resorted to type casting to get it done. Turns out I don’t need to do that. Was reading more about the Format-Table cmdlet...
View ArticleTaking PowerShell on a date
I needed to filter the event logs from a remote computer for power off events. The user was powering it off himself every now and then, but wouldn’t believe me when I said so. No problem, thanks to the...
View Article