Security Focus: Generate an Alphanumeric Password

If you have to have a password, it’s best to have a password that could contain special characters… but, what if you want to generate a password without special characters? Here’s a little function to do just that:   function New-AlphaNumericPassword { ##14 characters ##no special characters ##ASCII #48 -> 57 :: 0 -> 9…

0

Add Multi-Line Content to a Linux File with Add-Content

You have a large number of files to edit that are used by Linux servers. The editing and distributing of these files has to be done on a Windows platform. You want to append some multi-line detail to these files with PowerShell, but the file still needs to be compatible with Linux. Now, Add-Content with a here string would seem to…

2

One-Liner: PowerShell Pi Mnemonic

I love this. I came across it when looking into how to calculate Pi with PowerShell.   “$(‘How I wish I could calculate Pi better’.split(‘ ‘) | % {$_.length})”     I’ve tweaked it ever so slightly.   $(‘How I wish I could calculate Pi better’ -Split ” ” | % {[string]$a += $_.length}; $a.Insert(1,”.”))…

1

Profile Power: Adjust Console Opacity

WMF 5.1 comes with some cool improvements to the console. One of which I enable via my $profile, the script that runs when I start the PowerShell.exe host.     The WindowsAlpha registry value determine the opacity of the console, as does the Opacity slider below.     What’s in my $profile then?   Set-ItemProperty -Path…

0