Get-DictionaryFile
Description
Get-DictionaryFile creates all possible passwords based on the character set and parameters that you will use and saves the results in a text file.
Note: You need to install DictionaryFile module version 2.0 in order for this cmdlet to be available. For more information, see PowerShell Module DictionaryFile v2.0.
Syntax:
Get-DictionaryFile [-Path] <String> [<CommonParameters>]
If you want to find more about the specific cmdlet while you are in PowerShell you can use the below to get the help file.
Code:
Get-Help New-DictionaryFile
Output:
Now lets see few examples about Get-DictionaryFile
.
[adinserter name=”In Article”]
Examples
Example 1
In this example we will create passwords for the characters set “a,b,c,1,$” with minimum number of characters of two and maximum number of characters five. Generated passwords will be saved in C:\Scripts_Output\MyFile.txt.
PS C:\> Get-DictionaryFile -Path C:\Scripts\DictionaryFile.txt aa ab ac ba bb bc ca cb cc
Example 2
For this example we are using the same characters set as example 1 but we will include also the capital letters. Generated passwords will be saved in C:\Scripts_Output\MyFile.txt.
PS C:\> "C:\Scripts\DictionaryFile.txt" | Get-DictionaryFile aa ab ac ba bb bc ca cb cc
Example 3
Here we will see that we will have only the capital letters of our character set. Generated passwords will be saved in C:\Scripts_Output\MyFile.txt.
PS C:\> Get-DictionaryFile -Path "C:\Scripts\DictionaryFile.txt" | ForEach-Object {$_ + "a"} aaa aba aca baa bba bca caa cba cca
Example 4
For this example instead of using the characters one by one. I am providing the whole alphabet. Generated passwords will be saved in C:\Scripts_Output\MyFile.txt.
PS C:\> "C:\Scripts\DictionaryFile.txt" | Get-DictionaryFile | Where-Object {$_ -like "*b*"} ab ba bb bc cb
[adinserter name=”In Article”]
Required Parameters
-Path
- Required: True
- Position: 1
- Default value: None
- Accept pipeline input: True (ByValue)
- Accept wildcard characters: False
Inputs
System.String.
Get-DictionaryFile can accept a string value to determine the path of the dictionary file.
Outputs
System.Array.
Get-DictionaryFile will provide the passwords that where included in the dictionary file in an array.
[adinserter name=”In Article”]
Related Links
- PowerShell Module DictionaryFile v 2.0
- Get-PasswordCombination
- Get-PasswordNumber
- New-DictionaryFile
- PowerShell Gallery | DictionaryFile 2.0
- GitHub – SConstantinou/DictionaryFile
[adinserter name=”Matched-Content”]


Leave a Reply