Giter Site home page Giter Site logo

nameit's Introduction

PowerShell NameIT

PowerShell module for randomly generating names

This project is a port of https://github.com/mitchdenny/namerer. Hat tip to Mitch Denny.

In Action

image

image1

Release 1.7.0 : 10/3/2016

  • Generate random cmdlet names (verb-noun) and limit it to approved verbs
PS C:\> Invoke-Generate "[cmdlet]" -c 3
Boat-Other
Lawyer-South
Loose-Trip
PS C:\> Invoke-Generate "[cmdlet]" -c 3 -ApprovedVerb
Request-Purchase
Push-Grocery
Format-River
  • Thank you Chris Hunt for:
    • Adding the address feature (and more)
    • Suggesting of adding adjective, noun and verb

Manage Your PowerShell Window Titles

Put this line in your $Profile.

$Host.UI.RawUI.WindowTitle = Invoke-Generate "PowerShell[space]-[space][Adjective][Noun]"

Or try this gist snippet.

PS C:\> Invoke-Generate "[person],[space][address][space]" -c 5
Derrick Cox, 1 Yicxizehpuw Av
Bethany Jones, 237 Tataqe Keys
Courtney Lewis, 162 Goyinu Ranch
Stacy Davis, 127 Odwus Lgt
Shane Carter, 308 Qeep Harb

Release 1.04: 1/16/2016

PS C:\> Invoke-Generate "[person]" -c 3
Meghan Cruz
Cassandra Smith
Luis Flores
PS C:\> Invoke-Generate "[person female]" -c 3
Heather Rogers
Meghan Bailey
Julia Perez
PS C:\> Invoke-Generate "[person male]" -c 3
Chad Bailey
Jordan Gray
Matthew Jackson

Examples

Invoke-Generate
# Output:
lhcqalmf

Will generate an eight character name with a random set of characters in the A-Z alphabet. You can change which alphabet is being used by using the -alphabet parameter.

Invoke-Generate -alphabet abc
# Output:
cabccbca

This is just a default template, most users will have some idea of what they want to generate, but want to randomly splice in other characters to make it unique or come up with some other ideas. For this you can provide a template string.

Invoke-Generate "cafe###"
# Output:
cafe176

Using the ? symbol injects a random letter, the # symbol injects a random number.

Invoke-Generate "???###"
# Output:
yhj561

Template Functions

The ? and # characters in a template are just shorthand for functions that you can use in a template, so the previous example could also be written as:

Invoke-Generate "[alpha][alpha][alpha][numeric][numeric][numeric]"
# Output:
voe336

NameIT exposes a bunch of useful functions to help create more useful (and pronouncable names). Here is the current list that is supported:

  • [alpha]; selects a random character (constrained by the ```-alphabet` parameter).
  • [numeric]; selects a random numeric (constrained by the -numbers parameter).
  • [vowel]; selects a vowel from a, e, i, o or u.
  • [phoneticVowel]; selects a vowel sound, for example ou.
  • [consonant()]; selects a consonant from the entire alphabet.
  • [syllable]; generates (usually) a pronouncable single syllable.
  • [synonym word]; finds a synonym to match the provided word.
  • [person]; generate random name of female or male based on provided culture like <FirstName><Space><LastName>.
  • [person female];generate random name of female based on provided culture like <FirstName><Space><LastName>.
  • [person male];generate random name of male based on provided culture like <FirstName><Space><LastName>.
  • [address]; generate a random street address. Formatting is biased to US currently.
  • [space]; inserts a literal space. Spaces are striped from the templates string by default.

One of the most common functions you'll use is [syllable()] because it generally produces something that you can pronounce. For example, if we take our earlier cafe naming example, you might do something like this:

Invoke-Generate "cafe_[syllable][syllable]"
# Output:
cafe_amoy

You can combine the tempalate functions to produce some interesting results, for example here we use the [synonym] function with the [syllable] function to also replace the word cafe.

Invoke-Generate "[synonym cafe]_[syllable][syllable]"
# Output:
coffeehouse_iqza

You can also get the tool to generate a bunch of names at a time using the --count switch. Here is an example:

Invoke-Generate -count 5 "[synonym cafe]_[syllable][syllable]"
# Output:
restaurant_owkub
coffeebar_otqo
eatingplace_umit
coffeeshop_fexuz
coffeebar_zuvpe

You can generate also names of people like <FirstName><Space><LastName> based on provided sex (female/male/both) and culture (currently only en-US). The cultures can be added by putting csv files with the last/first names in the subfoders "cultures", in the module directory - please see en-US.csv for the file structure.

Invoke-Generate "[person female]" -count 3
# Output:
Jacqueline Walker
Julie Richardson
Stacey Powell

Stay tuned for additional capability

nameit's People

Contributors

cdhunt avatar dfinke avatar it-praktyk avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.