For any of those who use PowerCLI, I thought I would share what I consider my favourite bit of code. Create the file Initialize-PowerCLIEnvironment_Custom.ps1 in the scripts folder of a colleagues machine with the following content:
$name = "VMWare vSphere PowerCLI 6.3 Release 1" $fun_chars = $name.ToCharArray() $i = 0 while($i -lt 4){ $rand = Get-Random -Minimum 2 -Maximum $name.length $rand = [math]::Round($rand) $temp = $fun_chars[$rand].ToString() if ($temp -cmatch “^[A-Z]*$”) {$temp = $temp.ToLower()} else {$temp = $temp.ToUpper()} $fun_chars[$rand] = $temp $i++ } $fun_name = -join $fun_chars $host.ui.RawUI.WindowTitle = $fun_name
Details on the file can be found here:
submitted by /u/lanternisgreen
[link] [comments]
The post Mildly annoying a colleague appeared first on How to Code .NET.