• Stars
    star
    131
  • Rank 275,867 (Top 6 %)
  • Language
    PowerShell
  • License
    MIT License
  • Created almost 9 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PowerShell module for randomly generating data

PowerShell NameIT

PowerShell module for randomly generating names

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

v2.3.3

v2.3.2

  • Added job to template
ig '[person],[job]' -count 3

Alexandria Stephens,Biologist
Braiden Patel,Social media coordinator
Mya Perez,Principal

v2.3.2

Göran Hanell added names and color in Swedish.

ig '[color]' -Culture sv-SE -Count 5

grön
vit
orange
grå
rosa
ig '[person]' -Culture sv-SE -Count 5

Helen Holmberg
Sten Samuelsson
Sven Abrahamsson
Mona Ahmed
Anette Dahlberg

v2.3.0

  • Added
# Run on 12/31/2020

$templates = $(
    'ThisQuarter'
    'q1', 'q3', 'q3', 'q4'
    'Today', 'Tomorrow', 'Yesterday'
    'February', 'April', 'October'
)

foreach ($template in $templates) {
    $template | ForEach-Object {
        [PSCustomObject]@{
            Template = $_
            Result   = Invoke-Generate "$_" 
        }
    }
}

Prints

Generates these random dates.

Template    Result
--------    ------
ThisQuarter 10/23/2020
q1          3/15/2020
q3          7/12/2020
q3          9/18/2020
q4          10/12/2020
Today       12/31/2020
Tomorrow    1/1/2021
Yesterday   12/30/2020
February    2/15/2020
April       4/13/2020
October     10/8/2020
Item Description
January Generate a random date for this month
February Generate a random date for this month
March Generate a random date for this month
April Generate a random date for this month
May Generate a random date for this month
June Generate a random date for this month
July Generate a random date for this month
August Generate a random date for this month
September Generate a random date for this month
October Generate a random date for this month
November Generate a random date for this month
December Generate a random date for this month
ThisQuarter Generate a random date for this quarter
Q1 Generate a random date for Q1
Q2 Generate a random date for Q2
Q3 Generate a random date for Q3
Q4 Generate a random date for Q4
LastQuarter Generate a random date for last quarter
NextQuarter Generate a random date for next quarter
Today Generate todays date
Tomorrow Generate tomorrows date
Yesterday Generate yesterdays date

April 2019 - 2.1.0

Language/Culture can be passed directly to Invoke-Generate, which will apply to everything without an explicit override.

ig "[color][space][color en-GB]" -Culture ja-JP

This is especially easier when there's lots of arguments you have to get through to get to specify culture (last).

ig "[randomdate]"                                           # implicitly uses culture short date format
ig "[randomdate 1/1/1999 12/31/1999 'yyyy-MM-dd' ja-JP]"    # can't use culture format this way, have to specify format explicitly
ig "[randomdate]" -Culture ja-JP                            # lets the other arguments remain optional
  • Fixed module auto-loading from a regression in 2.1.0, and includes some internal fixes and changes.
  • Internal refactor to individual files.
  • Support added for multiple languages and cultures. Tries to give you results based on your current culture, or a specific one you provide.

image

ig "[color]"        # your current culture
ig "[color en-GB]"  # choosing lang-CULTURE
ig "[color ja]"     # choosing lang only

Falls back to "something in your chosen language" if specific culture is not available. Falls back to US English (en-US) if your language is not available at all.

ig "[color en-CA]"  # returns US English color because no Canadian English colors are defined (as of this writing)
ig "[noun en-GB]"   # returns US English noun because even though British English exists, there's no nouns file
ig "[color es]"     # returns US English because no Spanish language files exist yet

randomdate can now take a lower and upper bound on time and a format string. By default uses chosen culture's short date format.

ig "[randomdate]"                                           # a random date in my culture format
ig "[randomdate '1/1/2000']"                                # a random date from 1 Jan 2000 onward
ig "[randomdate '1/1/2000' '12/31/2000']"                   # a random date in the year 2000
ig "[randomdate '1/1/2000' '12/31/2000' 'dd MMM yyyy']"     # a random date in 2000 with a custom format

More information coming soon for contributors on how to deal (or not) with culture stuff.

September 2018

Added New-NameItTemplate. Pass an object with properties and it will generate a NameIT template.

If a property name has has the value name, zip, address, or state the appropriate NameIT template is applied, otherwise the type is inferred as numeric or alpha.

New-NameItTemplate {[PSCustomObject]@{Company="";Name=""}}
Company=[alpha 6]
Name=[person]

OR

Pass it to Invoke-Generate directly.

Invoke-Generate (New-NameItTemplate {[PSCustomObject]@{Company="";Name=""}}) -Count 5 -AsPSObject

Output

Name          Company
----          -------
Elvis Potts   cuajwj
Janae Herring kyzfgb
Cecelia Cruz  slseam
Akira Kelly   bltamv
Bella Bean    wfhats

In Action

image

image1

7/10/2018

  • Added badges
  • Added first|last for person address issue #16
[person female first]
[person female last]
[person male first]
[person male last]
[person both first]
[person both last]

Release 1.8.5 : 6/18/2018

Added RandomDate

ig "[person] [randomdate]" -Count 5
Austin Jones 06/04/2007
Kristin Hernandez 06/04/2007
Lindsay Richardson 06/04/2007
Alex Morales 06/04/2007
Nicholas Sanders 06/04/2007

Release 1.8.2 : 03/5/2017

Added more adjectives and stored them randomly, suggested by Joel Bennett.

Added guid to the template. Chris Hunt suggested and then delegated the implementation to me after I showed him I was randomly generating guid parts.

Invoke-Generate "[guid]"
Invoke-Generate "[guid 0]"
Invoke-Generate "[guid 3]"
690dcb11-a5b5-462a-a860-8de11626f5fd
eeb507b0
9873

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

More Repositories

1

ImportExcel

PowerShell module to import/export Excel spreadsheets, without Excel
PowerShell
2,215
star
2

PowerShellAI

PowerShell AI module for OpenAI GPT-3 and DALL-E
PowerShell
689
star
3

Tiny-PowerShell-Projects

Learning PowerShell through test-driven development of games and puzzles
PowerShell
368
star
4

powershell-for-developers

PowerShell examples for the book "PowerShell for Developers"
C#
158
star
5

PowerShellHumanizer

PowerShell Humanizer wraps Humanizer: meets all your .NET needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities
Jupyter Notebook
120
star
6

vscode-pandoc

Visual Studio Code extension lets you render markdown to pdf, word doc or html with pandoc
TypeScript
120
star
7

powershell-algorithms

Algorithms and data structures implemented in PowerShell with explanations and links to further readings - port of https://github.com/trekhleb/javascript-algorithms
PowerShell
117
star
8

PSharp

Productivity tool that makes PowerShell ISE better
PowerShell
110
star
9

PowerShellNotebook

Let's you automate PowerShell Notebooks with PowerShell at the command line, exports to Excel and more. On the gallery
PowerShell
110
star
10

powershell-notebooks

Get started learning PowerShell with PowerShell notebooks powered by .NET Interactive and VS Code.
PowerShell
92
star
11

InstallModuleFromGitHub

Install PowerShell Modules from GitHub
PowerShell
80
star
12

OutTabulatorView

PowerShell - Sending output to an interactive table in a browser
PowerShell
71
star
13

PSFuzzySearch

PowerShell Fuzzy search applies fuzzy searching to text
PowerShell
58
star
14

PoShLucene

PowerShell WPF GUI over Lucene.NET
PowerShell
52
star
15

PSAI

PowerShell AI module. Brings OpenAI to the console and scripts
PowerShell
51
star
16

PSStringScanner

Provides lexical scanning operations on a String
PowerShell
49
star
17

OneGetGistProvider

Gist-as-a-Package - PackageManagement PowerShell Provider to interop with Github Gists
PowerShell
45
star
18

PowerShellAIAssistant

Enhance PowerShell scripting with AI using PowerShell AI Assistant module.
PowerShell
43
star
19

edge-powershell

Run Powershell in node.js
C#
42
star
20

PSAdvantage

GitHub Actions at your Fingertips! ✨ - via PowerShell
PowerShell
40
star
21

PowerShellJson

Query JSON with PowerShell
PowerShell
38
star
22

Posh-Gist

PowerShell cmdlets for interacting with GitHub Gist
PowerShell
38
star
23

PSKit

A suite of command-line tools for working with PowerShell Arrays. From querying to doing array statistics.
PowerShell
37
star
24

edge-ps

PowerShell compiler for edge.js
JavaScript
37
star
25

IsePester

Module to integrate PowerShell Pester into ISE
PowerShell
34
star
26

PowerShellMicroservice

A PowerShell REST API running as a microservice in a Docker container.
PowerShell
32
star
27

ConvertToClass

PowerShell module to convert JSON or CSV to a PowerShell class definition
PowerShell
30
star
28

ConvertFromMarkdown

From your Markdown to generated chapters, run ScriptAnalyzer on your examples and generate HTML, a Word Doc or PDF. Table of Contents included
PowerShell
29
star
29

PSMatcher

PSMatcher is a test utility, that lets you easily test responses and json, when some part of the response is something out of your control (autogenerated id, guid, datetime etc). (And More)
PowerShell
29
star
30

PSWeave

PSWeave: a PowerShell module bringing OpenAI's GPT to your fingertips, and simplified prompt engineering
PowerShell
28
star
31

awesome-powershell-azure-functions

Curating the Best PowerShell Resources for Azure Functions
27
star
32

PSDataFrame

Use PowerShell to make data exploration easy
PowerShell
26
star
33

ServerlessPowerShell

PowerShell module that let's you rapidly deploy PowerShell scripts as Azure http trigger functions
PowerShell
25
star
34

OneGetGitHubProvider

GitHub-as-a-Package - PackageManagement PowerShell Provider to interop with Github
PowerShell
25
star
35

PowerShellAI-ContentGenerator

A versatile content generator using GPT and PowerShell
PowerShell
24
star
36

powershellScripts

PowerShell Scripts
JavaScript
24
star
37

PowerShellScottPlot

Jupyter Notebook
23
star
38

PSProse

PowerShell module for the Microsoft Program Synthesis SDK https://github.com/Microsoft/prose
PowerShell
23
star
39

dfinke

Use automation to increase bandwidth in order to address technical debt
PowerShell
21
star
40

PowerShellPivot

PowerShell
20
star
41

ODataExplorer

An 'OData Explorer' PowerShell application designed to allow ad-hoc browsing of OData Services
PowerShell
18
star
42

PowerShellCombinations

Using PowerShell Classes & Script to generate and manipulate combinations and permutations
PowerShell
18
star
43

PSPx

PowerShell module that can execute scripts written in markdown that can be accessed either locally or via a URL
PowerShell
17
star
44

PSYamlQuery

PowerShell wrapper for `yq`, enables a better PowerShell pipeline experience
PowerShell
16
star
45

SharePowerShell

Easily share (and get) PowerShell Scripts from ISE or the command line!
PowerShell
15
star
46

PowerShellCheatSheets

15
star
47

PowerShellConsole

Create a PowerShell Console using the AvalonEdit control
C#
14
star
48

PowerShellGemini

PowerShell integration for Google's versatile Gemini Pro API
PowerShell
14
star
49

PSDuckDB

PSDuckDB is a PowerShell module that provides seamless integration with DuckDB, enabling efficient execution of analytical SQL queries directly from the PowerShell environment.
PowerShell
14
star
50

openai-powershell-samples

Jupyter Notebook
13
star
51

SortingAlgorithms

Sorting in PowerShell
PowerShell
12
star
52

PowerShellAI.Functions

PowerShell module bridging PowerShell functions and OpenAI
Jupyter Notebook
12
star
53

PowerShellPhantomJS

PowerShell over PhantomJS, a headless WebKit scriptable with a JavaScript API
PowerShell
12
star
54

WebScraping

PowerShell
11
star
55

PowerShellASTDemo

PowerShell - Showing Tokenization and the Abstract Syntax Tree
PowerShell
11
star
56

PSJsonTerm

PowerShell UI for exploring and querying JSON
PowerShell
10
star
57

PowerShellJsonObject

PowerShell
10
star
58

PowerShellArrayMethods

Use PowerShell's Extended Type System and Ruby language methods
PowerShell
10
star
59

config-ps

Write your .NET configuration files in PowerShell
C#
10
star
60

PowerShellKV

A key value store that allows you to save snippets of text that you can later find and copy to your clipboard
PowerShell
10
star
61

PasteJSONasPowerShell

Converting your JSON objects into PowerShell functions
PowerShell
10
star
62

SimplePSHttpServer

Simple PowerShell Http Server
10
star
63

dfinke.github.io

https://dfinke.github.io/
Ruby
10
star
64

PowerShellExcel-Snippets

Contains the code snippets for PowerShell Excel development in the VS Code editor
PowerShell
10
star
65

GPT-FunctionCalling

Jupyter Notebook
9
star
66

NPMTabCompletion

Enables tab completion for npm commands
PowerShell
9
star
67

PowerShellScaffold

Quickly create a suite of PowerShell functions
PowerShell
8
star
68

PSPulumi

PowerShell module for Pulumi: Program the Cloud
PowerShell
8
star
69

PowerShell_Roslyn_Code_Quoter

PowerShell Roslyn Code Quoter Tool - generating syntax tree API calls that result in a given C# program.
PowerShell
8
star
70

PowerShellSlackathon

Stupid ideas for the PowerShell Slackathon
PowerShell
7
star
71

known-calendar

PowerShell wrapper for nChronic, a natural language date/time parser
PowerShell
7
star
72

PowerShellContextSplit

The Invoke-ContextSplit command copies the specified file and separates the copy into segments.
PowerShell
7
star
73

PSRunFromZip

PowerShell script to deploy Azure Functions from the command line using Run-From-Zip
PowerShell
7
star
74

PowerShellTools

Collection of PowerShell modules and scirpts to make things simpler
PowerShell
7
star
75

PoShDotNet

.NET Core PowerShell wrapper for dotnet
PowerShell
7
star
76

PowerShellAylien

PowerShell Module to interact with AYLIEN Text Analysis API - a package consisting of eight different Natural Language Processing, Information Retrieval and Machine Learning APIs that can be adapted to your processes and applications with relative ease
PowerShell
7
star
77

SpellingCorrector

PowerShell Spelling Corrector
PowerShell
6
star
78

PSSpeak

HTML
6
star
79

PowerShellSequenceUtils

Jupyter Notebook
6
star
80

SlackDSCResource

PowerShell Slack DSC Provider lets you send messages to Slack
PowerShell
6
star
81

PSGitHubCLICrescendo

PowerShell
5
star
82

VSCETabCompletion

Enables tab completion for vsce commands
PowerShell
5
star
83

powershell-azure-function-stockdata

PowerShell Azure Function for displaying stock information
PowerShell
5
star
84

PowerShell_Highlighter

Reads a PowerShell Script, writes it to the screen and color encodes it
5
star
85

PowerShellTranslate

PowerShell Invoke-Translate and New-TranslationTable typically used in substitution ciphers
PowerShell
5
star
86

StartPowerShellDemo

Start PowerShell demo from a Markdown file
PowerShell
5
star
87

PowerShell_Search_Bing

PowerShell function to interact with the new Bing Web Search API on Azure
PowerShell
5
star
88

GetBingPics

PowerShell script for searching and downloading images from the Bing API
PowerShell
5
star
89

HtmlPageFromPowerShellAzureFunction

PowerShell
5
star
90

PSCargoCompletion

PowerShell - Two for one. Auto complete for ruts's 'cargo' command and the script that does the code generation for it
PowerShell
5
star
91

PowerShellISE

A PowerShell module that lists all the ISE shortcut keys
PowerShell
4
star
92

PSGitQL

A PowerShell git query language
PowerShell
4
star
93

PowerShellNancy

PowerShell using the Nancy framework for building HTTP based
PowerShell
4
star
94

vscode-PSStackoverflow

From VS Code Search for selected text + the PowerShell tag on Stack Overflow
TypeScript
4
star
95

BladePS

Implementation of mustache.js for PowerShell
PowerShell
4
star
96

powershell-azure-function-mashup-dad-jokes-cat-pics

Powershell Azure Function Mashup - Dad Jokes and Cat Pics
PowerShell
4
star
97

PowerShell_And_Microsoft_Roslyn

Integrating PowerShell and Roslyn,the next generation of language object models for code generation, analysis, and refactoring
4
star
98

PowerShellShorts

PowerShell
3
star
99

AzureFunctions

PowerShell module for Azure Functions
PowerShell
3
star
100

PSGistIT

Create Github gists of files using one single command, Export-Gist
PowerShell
3
star