Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

Mildly annoying a colleague

$
0
0

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:

https://pubs.vmware.com/vsphere-51/index.jsp?topic=%2Fcom.vmware.powercli.ug.doc%2FGUID-436C93D3-AFE9-4279-8A05-D4ED5E839C31.html

submitted by /u/lanternisgreen
[link] [comments]

The post Mildly annoying a colleague appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793

Trending Articles