It was the copy/paste or listmanager software. My source comes from
PowerGUI (free powershell editor) which helps with auto-indent and
pretty-printing. Let me see if I can find a good example...
Ah, here's something I hacked from someone elses existing code. Gist
supports powershell, so it gives a better representation of what it usually
looks like.
https://gist.github.com/derekmurawsky/1345e55699343ec4ea9c
The problem was that I needed to plan for SHA-1 Depreciation for SSL
certificates. With this snippet, I was able to use a CSV of my production
URLs and find out what the algorithm in use is. It was just about as simple
as: import-csv | get-sslsigningalgorithm | export-csv
Objects + Pipes = Win
-D


On Tue, Nov 18, 2014 at 1:55 PM, John Stoffel <[email protected]> wrote:

> >>>>> "Derek" == Derek Murawsky <[email protected]> writes:
>
> Derek> @Adam, Just busting chops. I like to joke about everything,
> Derek> including stereotypical sysadmins (on the windows or nix
> Derek> sides). Keeps things light. :)
>
> Derek> Below is a set of scripts, in a PS Module, that I wrote to help
> Derek> maintain offshore development accounts in Active Directory. I
> Derek> have a CSV template which the offshore team managers fill out
> Derek> and send me with their changes. There are many additional
> Derek> features/comments that I need to add, but this has already
> Derek> saved me a lot of time. I'll probably be open sourcing this in
> Derek> the long run, just so others can use it more readily and
> Derek> contribute back.
>
> Derek> import-module activedirectory
>
> Derek> function new-emailaddress{
> Derek> [cmdletbinding(SupportsShouldProcess=$True)]
> Derek> param (
> Derek> [parameter(Mandatory=$true)]
> Derek> [string] $FirstName,
> Derek> [parameter(Mandatory=$true)]
> Derek> [string] $LastName,
> Derek> [parameter(Mandatory=$true)]
> Derek> [string] $Company
> Derek> )
> Derek> switch ($Company.ToLower()) {
> Derek> infobeans {$retval = $FirstName + "." + $LastName + "@infobeans.com
> "}
> Derek> annet {$retval = $FirstName + "." + $LastName + "@annet.com"}
> Derek> mindtree {$retval = $FirstName + "_" + $LastName + "@mindtree.com"}
> Derek> default {$retval = $FirstName + "." + $LastName + "@example.com"}
> Derek> }
> Derek> return $retval
> Derek> }
>
> Ok, so is it me, or just bad cut'n'paste?  Do PowerShell scripts ever
> use any indentation?  It's a struggle to read this!
>
>
_______________________________________________
Tech mailing list
[email protected]
https://lists.lopsa.org/cgi-bin/mailman/listinfo/tech
This list provided by the League of Professional System Administrators
 http://lopsa.org/

Reply via email to