Table of Contents

Data

New-Password

Generate a new password.

New-Password
[-AsSecureString]
[-IncludeSymbols]
[-Length] <Int32>
[<CommonParameters>]

-AsSecureString

The flag to return the value as a secure string.

Type SwitchParameter
Accepts pipeline input False

-IncludeSymbols

The flag to include symbols in the password.

Type SwitchParameter
Accepts pipeline input False

-Length

The length of the password to generate.

Type Int32
Accepts pipeline input False
Example 1

Creates a new password with a length of 16.

New-Password -Length 16
# ex. 1Ze7kOaqFzxjCLhT
Example 2

Creates a new password with a length of 8 that also includes symbols.

New-Password -Length 8 -IncludeSymbols
# ex. Q%I6*aZx

back to top

New-RandomCityName

Generate a random city name.

New-RandomCityName
[<CommonParameters>]
Example

Gets a new random city name.

New-RandomCityName
# ex. Easley

back to top

New-RandomFirstName

Generate a random first name.

New-RandomFirstName
[<CommonParameters>]
Example

Gets a new random name.

New-RandomFirstName
# ex. Bobby

back to top

New-RandomLastName

Generate a random last name.

New-RandomLastName
[<CommonParameters>]
Example

Gets a new random last name.

New-RandomLastName
# ex. Cannon

back to top

New-RandomName

Generate a random name with first and last name.

New-RandomName
[<CommonParameters>]
Example

Gets a random name of both first and last name.

New-RandomName
# ex. Bobby Cannon

back to top

New-RandomNumber

Generate a random number name.

New-RandomNumber
[-Maximum] <Decimal>
[-Minimum] <Decimal>
[-Scale] <Byte>
[<CommonParameters>]

-Maximum

The inclusive upper bound of the random number returned. This value must be greater than or equals to Minimum. Defaults to [decimal]::MaxValue.

Type Decimal
Accepts pipeline input False

-Minimum

The inclusize lower bound of the random number returned. Defaults to 0.

Type Decimal
Accepts pipeline input False

-Scale

The scale of the number to return. Defaults to 0.

Type Byte
Accepts pipeline input False
Example 1

Gets a new random number.

New-RandomNumber
# ex. 16234
Example 2

Gets a new random number between 1 and 10.

New-RandomNumber -Minimum 0 -Maximum 10
# ex. 7

back to top

New-RandomStateName

Generate a random state name.

New-RandomStateName
[-Abbreviate]
[<CommonParameters>]

-Abbreviate

Determine if the state name should be abbreviated.

Type SwitchParameter
Accepts pipeline input False
Example 1

Gets a random state name by full name.

New-RandomStateName
# ex. South Carolina
Example 2

Gets a random state name in an abbreviated format.

New-RandomStateName -Abbreviate
# ex. SC

back to top

New-RandomStreetName

Generate a random street name.

New-RandomStreetName
[-ExcludeSuffix]
[<CommonParameters>]

-ExcludeSuffix

The flag to exclude the street suffix.

Type SwitchParameter
Accepts pipeline input False
Example 1

Gets a random street name with suffix.

New-RandomStreetName
# ex. Frontage Road
Example 2

Gets a random street name without the suffix.

New-RandomStreetName -ExcludeSuffix
# ex. Frontage

back to top

Environment

Add-ToEnvironmentPath

Adds a path to the Windows path ($env:Path).

Add-ToEnvironmentPath
[-Target] <EnvironmentVariableTarget>
[-Path] <String>
[-WhatIf]
[<CommonParameters>]

-Target

Specifies the enviroment location of the path to update. Defaults to "Machine".

Type EnvironmentVariableTarget
Accepts pipeline input False

-Path

The path to add to the Windows path. Defaults to the current location.

Type String
Position Named
Accepts pipeline input True (ByPropertyName)

back to top

Get-EnvironmentVariable

Gets the environment variable value.

Get-EnvironmentVariable
-Variable <String>
[-Target] <EnvironmentVariableTarget>
[<CommonParameters>]

-Variable

The name of the variable to get.

Type String
Position Named
Accepts pipeline input True (ByPropertyName)

-Target

Specifies the enviroment location of the path to query. Defaults to "Machine".

Type EnvironmentVariableTarget
Accepts pipeline input False

back to top

Get-RuntimeInformation

The runtime information of the current session of OmniShell.

Get-RuntimeInformation
[<CommonParameters>]
Example
Get-RuntimeInformation | Format-List
# ex.
# Bitness : x64
# ElapsedTime : 00:00:09.7119186
# IsElevated : False
# LoadTime : 00:00:03.4386200
# StartTime : 00:00:02.1470530
# Version : 2.7.9.11746

back to top

Set-EnvironmentVariable

Sets the environment variable value.

Set-EnvironmentVariable
-Variable <String>
-Value <String>
[-Target] <EnvironmentVariableTarget>
[-WhatIf]
[<CommonParameters>]

-Variable

The name of the variable to get.

Type String
Position Named
Accepts pipeline input True (ByPropertyName)

-Value

The name of the variable to set.

Type String
Position Named
Accepts pipeline input True (ByPropertyName)

-Target

Specifies the enviroment location of the path to query. Defaults to "Machine".

Type EnvironmentVariableTarget
Accepts pipeline input False

back to top

Network

Get-FtpChildItem

Get a list of files from an FTP server.

Get-FtpChildItem
-Path <String>
[-Credential] <PSCredential>
[-Passive]
[-Secure]
[<CommonParameters>]

-Path

The path of the item on the FTP server.

Type String
Accepts pipeline input False

-Credential

An optional parameter for credentials to access the FTP server.

Type PSCredential
Accepts pipeline input False

-Passive

An optional flag to indicate the connection is passive. Defaults to true.

Type SwitchParameter
Accepts pipeline input False

-Secure

An optional flag to indicate the connection is secure. Defaults to true.

Type SwitchParameter
Accepts pipeline input False

back to top

Get-FtpContent

Gets the content of an item from a FTP server.

Get-FtpContent
-Path <String>
[-Credential] <PSCredential>
[-Passive]
[-Secure]
[<CommonParameters>]

-Path

The path of the item on the FTP server.

Type String
Accepts pipeline input False

-Credential

An optional parameter for credentials to access the FTP server.

Type PSCredential
Accepts pipeline input False

-Passive

An optional flag to indicate the connection is passive. Defaults to true.

Type SwitchParameter
Accepts pipeline input False

-Secure

An optional flag to indicate the connection is secure. Defaults to true.

Type SwitchParameter
Accepts pipeline input False

back to top

Get-WebFile

Downloads a file from the web.

Get-WebFile
-FilePath <String>
-Uri <String>
[-Force]
[<CommonParameters>]

Downloads a file from the web. A progress bar will show progress.

-FilePath

The local file path to store the download.

Type String
Accepts pipeline input False

-Uri

The URI of the file to download. Must begin with "http" or "https".

Type String
Accepts pipeline input False

-Force

An optional parameter to force overwriting any existing file.

Type SwitchParameter
Accepts pipeline input False

back to top

Invoke-WebApi

Invokes a web location and return the data.

Invoke-WebApi
-Uri <String>
[-Credential] <PSCredential>
[-Headers] <Hashtable>
[-Method] <String>
[-Timeout] <Int32>
[-Value] <Object>
[<CommonParameters>]

-Uri

The URI of the web location to access. Must begin with "http" or "https".

Type String
Position Named
Accepts pipeline input True (ByPropertyName)

-Credential

The credientials to use to access the web location.

Type PSCredential
Accepts pipeline input False

-Headers

Type Hashtable
Accepts pipeline input False

-Method

The method of the request. The default value is "GET". Possible values are GET, PUT, POST, PATCH, and DELETE.

Type String
Accepts pipeline input False

-Timeout

Type Int32
Accepts pipeline input False

-Value

The object to be sent with the request. Only valid for POST, PUT, and PATCH methods.

Type Object
Accepts pipeline input False
Example

Access the OmniShell cmdlet documentation.

Invoke-WebApi "https://code.epiccoders.com/Page/46#Invoke-WebApi"

back to top

Security

Get-WindowsCredential

Gets a credential from the Windows Credential Manager.

Get-WindowsCredential
-Name <String>
[<CommonParameters>]

-Name

The name of the credential to read. Will use the selected credential if the name is provided.

Type String
Position Named
Accepts pipeline input True (ByPropertyName)
Example

Gets the windows credential by name.

Get-WindowsCredential -Name "Online Bank"
# ex.
# UserName Password
# -------- --------
# John Doe System.Security.SecureString

back to top

New-PublicPrivateKey

Generate a new public private key pair.

New-PublicPrivateKey
[-KeySize] <Int32>
[<CommonParameters>]

Generate a new public private key pair of a specified size.

-KeySize

The size of the key value pair.

Type Int32
Position Named
Accepts pipeline input True (ByPropertyName)
Example

Create a new public private key of size 2048.

New-PublicPrivateKey -KeySize 2048
# ex.
# PrivateKey
# ----------
# <RSAKeyValue><Modulus>pKKRSY9jZ4vrRbMk9ET8ntO8iXhl330dg3PWvHcWkSuncGpQSWz8SEXLAIaxQsiIJyz7RZW3EUE4aPCXDno+w9KwfTH12USF9uCXsL2A0KLMPPArQGYRrbHMgOU0HoVGhTdkxrzob91LVWRQO0nkYvjKLRjb3TqJ6MzyJvwENoo/IoaWtj2VpsGyKugYsKTWWIwZYJ5cBwXu9FRSn6p1ut0DoS96dKAdZ4fAVMMkXJhdlT4jxIMOsqsJwXW/P6xy9YKOyQxZigjx7mFmy8PjkXXRD4si1091sFX9a/K2Tq2TVOaPpBPTzAUGM1ldBzEtD/jLJ0tvhQSIAwM1OXq45Q==</Modulus><Exponent>AQAB</Exponent><P>z...

back to top

Set-WindowsCredential

Sets a credential from the Windows Credential Manager.

Set-WindowsCredential
-Name <String>
-Credential <PSCredential>
[<CommonParameters>]

-Name

The name of the credential to write.

Type String
Accepts pipeline input False

-Credential

The credential to be written to the Windows Credential Manager.

Type PSCredential
Position Named
Accepts pipeline input True (ByPropertyName)
Example
Set-WindowsCredential -Name "Online Bank" -Credential (Get-Credential)
# ex.
# cmdlet Get-Credential at command pipeline position 1
# Supply values for the following parameters:
# Credential: John Doe
# Windows PowerShell credential request
# Enter your credentials.
# Password: *********

back to top

Server

Get-WebServer

Gets the web servers that are currently running.

Get-WebServer
[<CommonParameters>]
Example

Get the list of running web servers.

Get-WebServer
# ex.
# Uri
# ---
# http://localhost:8080/
# http://localhost:8080/api/product/

back to top

Start-WebServer

Start a web server.

Start-WebServer
-Uri <String>
-OnRequest <ScriptBlock>
[<CommonParameters>]

-Uri

The URI of the web server.

Type String
Position Named
Accepts pipeline input True (ByPropertyName)

-OnRequest

The script block to handle the request.

Type ScriptBlock
Position Named
Accepts pipeline input True (ByPropertyName)
Example

Starts a web server running on localhost and port 8080.

Start-WebServer -Uri http://localhost:8080 -OnRequest { 
param ([string] $uri, [string] $method, [string] $data, [string] $headers)
return @{ Message = "$uri, $method, $data, $headers" }
}

# ex.
# Web server (http://localhost:8080/) running...
# http://localhost:8080/

back to top

Stop-WebServer

Stops a web server.

Stop-WebServer
-Uri <String>
[<CommonParameters>]

-Uri

The URI of the web server.

Type String
Position Named
Accepts pipeline input True (ByPropertyName)
Example 1

Stops the web server running at uri localhost.

Stop-WebServer -Uri http://localhost
Example 2

Stops all web servers returned from Get-WebServer.

Get-WebServer | Stop-WebServer

back to top

Shell

Get-LicenseStatus

Gets the license status of OmniShell.

Get-LicenseStatus
[<CommonParameters>]
Example

Gets the status of the OmniShell license.

Get-LicenseStatus
# ex.
# ExpiresOn HardwareId IsValid Name
# --------- ---------- ------- ----
# 5/16/17 1:46:06 PM 12345612345612345612345612345612 True John Doe

back to top

Invoke-ChangeBitness

Change the bitness of the OmniShell application.

Invoke-ChangeBitness
[<CommonParameters>]

Change the bitness of the OmniShell application from x64 to x86 or the other way around.

back to top

Invoke-Elevate

Elevate OmniShell to a high privilege level by giving explicit consent through the Consent UI.

Invoke-Elevate
[<CommonParameters>]
Example

Restart and elevate the OmniShell application.

Invoke-Elevate

back to top

Invoke-Restart

Restarts OmniShell.

Invoke-Restart
[-Elevate]
[<CommonParameters>]

-Elevate

The flag to elevate to high privilege level. Requires approval through the Consent UI.

Type SwitchParameter
Accepts pipeline input False
Example 1

Restart the OmniShell application.

Invoke-Restart
Example 2

Restart and elevate the OmniShell application.

Invoke-Restart -Elevate

back to top

Invoke-UpdateCheck

Invokes an update check for OmniShell.

Invoke-UpdateCheck
[<CommonParameters>]
Example
Invoke-UpdateCheck

back to top

Open-File

Opens a file in the text editor.

Open-File
-Path <String>
[-WhatIf]
[<CommonParameters>]

-Path

The path to the file to open.

Type String
Position Named
Accepts pipeline input True (ByPropertyName)
Example

Opens the example.ps1 file.

Open-File example.ps1

back to top

Reset-OmniShell

Resets the OmniShell PowerShell session.

Reset-OmniShell
[<CommonParameters>]
Example

Restart the OmniShell PowerShell session.

Reset-OmniShell

back to top

Restart-OmniShell

Restart the OmniShell application.

Restart-OmniShell
[-Elevate]
[<CommonParameters>]

-Elevate

The flag to elevate to high privilege level. Requires approval through the Consent UI.

Type SwitchParameter
Accepts pipeline input False
Example 1

Restart the OmniShell application.

Restart-OmniShell
Example 2

Restart and elevate the OmniShell application.

Restart-OmniShell -Elevate

back to top

Sql

Compare-SqlDatabases

Compare two different SQL databases.

Compare-SqlDatabases
-DestinationDatabase <String>
-SourceDatabase <String>
[-DestinationCredential] <PSCredential>
[-DestinationServer] <String>
[-SourceCredential] <PSCredential>
[-SourceServer] <String>
[-WhatIf]
[<CommonParameters>]

-DestinationDatabase

The name of the destination database.

Type String
Accepts pipeline input False

-SourceDatabase

The name of the source database.

Type String
Accepts pipeline input False

-DestinationCredential

The credentials to access the destination SQL server.

Type PSCredential
Accepts pipeline input False

-DestinationServer

The server name of where the destination database exists. Defaults to "localhost" if not provided.

Type String
Accepts pipeline input False

-SourceCredential

The credentials to access the source SQL server.

Type PSCredential
Accepts pipeline input False

-SourceServer

The server name of where the source database exists. Defaults to "localhost" if not provided.

Type String
Accepts pipeline input False
Example

Compares the Test database with the Test2 database

Compare-SqlDatabases -SourceServer localhost -SourceDatabase Test -DestinationServer localhost -DestinationDatabase Test2

back to top

Export-SqlTable

Export SQL table data into a SQL file.

Export-SqlTable
-Database <String>
-Table <String>
[-Credential] <PSCredential>
[-Server] <String>
[-Where] <String>
[<CommonParameters>]

-Database

The name of the database that contains the table.

Type String
Accepts pipeline input False

-Table

The name of the table to export.

Type String
Accepts pipeline input False

-Credential

An optional parameter for credentials to access the SQL server.

Type PSCredential
Accepts pipeline input False

-Server

The server name of where the database exists. Defaults to "localhost" if not provided.

Type String
Accepts pipeline input False

-Where

Type String
Accepts pipeline input False
Example
Export-SqlTable -Server localhost -Database Test -Table Users

back to top

Get-SqlTable

Reads a list of SQL table values from a database.

Get-SqlTable
-Database <String>
[-Credential] <PSCredential>
[-Force]
[-Server] <String>
[-Table] <String>
[<CommonParameters>]

-Database

The name of the database to get tables for.

Type String
Accepts pipeline input False

-Credential

The credentials to access the SQL server.

Type PSCredential
Accepts pipeline input False

-Force

An optional parameter to force reloading of the data.

Type SwitchParameter
Accepts pipeline input False

-Server

The server name of where the database exists. Defaults to "localhost" if not provided.

Type String
Accepts pipeline input False

-Table

The table name to filter results.

Type String
Accepts pipeline input False
Example
Get-SqlTable -Server localhost -Database Test

back to top

Get-SqlTableColumn

Gets a list of SQL columns for a table.

Get-SqlTableColumn
-Database <String>
-Table <String>
[-Column] <String>
[-Credential] <PSCredential>
[-Force]
[-Server] <String>
[<CommonParameters>]

-Database

The name of the database to get tables for.

Type String
Accepts pipeline input False

-Table

The name of the table to get the columns for.

Type String
Accepts pipeline input False

-Column

The column name to filter results.

Type String
Accepts pipeline input False

-Credential

The credentials to access the SQL server.

Type PSCredential
Accepts pipeline input False

-Force

An optional parameter to force reloading of the data.

Type SwitchParameter
Accepts pipeline input False

-Server

The server name of where the database exists. Defaults to "localhost" if not provided.

Type String
Accepts pipeline input False

back to top

Get-SqlTableInsert

Create a new insert statement for the provided table.

Get-SqlTableInsert
-Database <String>
-Table <String>
[-Credential] <PSCredential>
[-Force]
[-Server] <String>
[-Values] <Hashtable>
[-Where] <String>
[<CommonParameters>]

-Database

The name of the database containing the table.

Type String
Accepts pipeline input False

-Table

The name of the table to generate the insert for.

Type String
Accepts pipeline input False

-Credential

The credentials to access the SQL server.

Type PSCredential
Accepts pipeline input False

-Force

An optional parameter to force reloading of the data.

Type SwitchParameter
Accepts pipeline input False

-Server

The server name of where the database exists. Defaults to "localhost" if not provided.

Type String
Accepts pipeline input False

-Values

A set of optional values to default with.

Type Hashtable
Accepts pipeline input False

-Where

An optional filter that will be used when quering the table. If not set the insert will be random data.

Type String
Accepts pipeline input False

back to top

Invoke-SqlNonQuery

Invokes a SQL non query and returns the number of changed rows.

Invoke-SqlNonQuery
-Database <String>
-Query <String>
[-Credential] <PSCredential>
[-Server] <String>
[-WhatIf]
[<CommonParameters>]

-Database

The name of the database.

Type String
Accepts pipeline input False

-Query

The query to invoke.

Type String
Accepts pipeline input False

-Credential

The credentials to access the SQL server.

Type PSCredential
Accepts pipeline input False

-Server

The server name of where the database exists. Defaults to "localhost" if not provided.

Type String
Accepts pipeline input False

back to top

Invoke-SqlQuery

Invokes a SQL query and returns the data.

Invoke-SqlQuery
-Database <String>
-Query <String>
[-Credential] <PSCredential>
[-Server] <String>
[<CommonParameters>]

-Database

The name of the database.

Type String
Accepts pipeline input False

-Query

The query to invoke.

Type String
Accepts pipeline input False

-Credential

The credentials to access the SQL server.

Type PSCredential
Accepts pipeline input False

-Server

The server name of where the database exists. Defaults to "localhost" if not provided.

Type String
Accepts pipeline input False

back to top

New-EntityFrameworkDatabase

Create a new entity framework database from a SQL database.

New-EntityFrameworkDatabase
-Database <String>
-DatabaseName <String>
-DataNamespace <String>
-DataPath <String>
[-ConnectionStringName] <String>
[-Credential] <PSCredential>
[-DatabaseNamespace] <String>
[-DatabasePath] <String>
[-EnableSpeedySupport]
[-EntityNamespace] <String>
[-EntityPath] <String>
[-ExcludedTables] <String[]>
[-ForceFullNamespaces]
[-ForceMappingColumnOrder]
[-ForceMappingName]
[-MappingNamespace] <String>
[-MappingPath] <String>
[-NameOverrides] <Hashtable>
[-Server] <String>
[-TestFactoryNamespace] <String>
[-TestFactoryPath] <String>
[-TestNamespace] <String>
[-TestPath] <String>
[<CommonParameters>]

-Database

Type String
Accepts pipeline input False

-DatabaseName

Type String
Accepts pipeline input False

-DataNamespace

Type String
Accepts pipeline input False

-DataPath

Type String
Accepts pipeline input False

-ConnectionStringName

Type String
Accepts pipeline input False

-Credential

Type PSCredential
Accepts pipeline input False

-DatabaseNamespace

Type String
Accepts pipeline input False

-DatabasePath

Type String
Accepts pipeline input False

-EnableSpeedySupport

Type SwitchParameter
Accepts pipeline input False

-EntityNamespace

Type String
Accepts pipeline input False

-EntityPath

Type String
Accepts pipeline input False

-ExcludedTables

Type String[]
Accepts pipeline input False

-ForceFullNamespaces

Type SwitchParameter
Accepts pipeline input False

-ForceMappingColumnOrder

Type SwitchParameter
Accepts pipeline input False

-ForceMappingName

Type SwitchParameter
Accepts pipeline input False

-MappingNamespace

Type String
Accepts pipeline input False

-MappingPath

Type String
Accepts pipeline input False

-NameOverrides

Type Hashtable
Accepts pipeline input False

-Server

The server name of where the database exists. Defaults to "localhost" if not provided.

Type String
Accepts pipeline input False

-TestFactoryNamespace

Type String
Accepts pipeline input False

-TestFactoryPath

Type String
Accepts pipeline input False

-TestNamespace

Type String
Accepts pipeline input False

-TestPath

Type String
Accepts pipeline input False

back to top

Utility

ConvertFrom-Base64

Converts from a base 64 string.

ConvertFrom-Base64
-Value <String>
[<CommonParameters>]

Converts the specified base 64 encoded string to an decoded string.

-Value

The base 64 string to decode.

Type String
Position Named
Accepts pipeline input True (ByPropertyName)
Example 1
ConvertFrom-Base64 Qm9iYnkgQ2Fubm9u
# ex. Bobby Cannon
Example 2
ConvertFrom-Base64 -Value SGVsbG8gV29ybGQ=
# ex. Hello World

back to top

ConvertFrom-Markdown

Converts from markdown to html.

ConvertFrom-Markdown
-Value <String>
[<CommonParameters>]

Converts the specified markdown string to an html string.

-Value

The markdown string to convert.

Type String
Position Named
Accepts pipeline input True (ByPropertyName)
Example
ConvertFrom-Markdown "# Test"
# ex. <h1>Test</h1>

back to top

ConvertTo-Base64

Converts to a base 64 string.

ConvertTo-Base64
-Value <String>
[<CommonParameters>]

Converts the string to a base 64 encoded string.

-Value

The string to convert.

Type String
Position Named
Accepts pipeline input True (ByPropertyName)
Example 1
ConvertTo-Base64 "Bobby Cannon"
# ex. Qm9iYnkgQ2Fubm9u
Example 2
ConvertTo-Base64 -Value "Hello World"
# ex. SGVsbG8gV29ybGQ=

back to top

ConvertTo-String

Converts the byte array into a string.

ConvertTo-String
-Value <Byte[]>
[<CommonParameters>]

-Value

The byte array to convert.

Type Byte[]
Position Named
Accepts pipeline input True (ByPropertyName)
Example 1
ConvertTo-String (65,66,67)
# ex. ABC
Example 2
ConvertTo-String -Value (65,66,67)
# ex. ABC
Example 3
,(65,66,67) | ConvertTo-String
# ex. ABC
Example 4
(65,66,67) | ConvertTo-String
# ex.
# A
# B
# C

back to top

Get-FactoryMethodForType

Generates a factory method for the provided type.

Get-FactoryMethodForType
-FilePath <String>
-TypeName <String>
[<CommonParameters>]

-FilePath

The path to the file containing the type.

Type String
Accepts pipeline input False

-TypeName

The name of the type to generate asserts for.

Type String
Accepts pipeline input False

back to top

Get-Hash

Gets an hash

Get-Hash
-Value <String>
[-Type] <HashType>
[<CommonParameters>]

Converts the string to a hash.

-Value

The value to be hashed.

Type String
Position Named
Accepts pipeline input True (ByPropertyName)

-Type

The type of hash to be performed. Default to MD5.

Type HashType
Position Named
Accepts pipeline input True (ByPropertyName)
Example 1
Get-Hash Bobby
# ex. 657b3da92ee342d7f1eeb4c0454e1448
Example 2
Get-Hash -Value Bobby -Type MD5
# ex. 657b3da92ee342d7f1eeb4c0454e1448
Example 3
Get-Hash -Value Bobby -Type SHA1
# ex. 6028c94f2113ccbdea89f2c561aa532ffa4a9eca
Example 4
Get-Hash -Value Bobby -Type SHA256
# ex. 4a70dab2cb4de46e76acd8cf72651a89ab4d85b2b0cbe8afaa43d4a731704688
Example 5
Get-Hash -Value Bobby -Type SHA512
# ex. b73ec4c90b72101afa9146aa17f6ec00a4c304ec92133cdfbf31e9f498f72e579e48ca56d2db8656193955a84a094eb79203d991d0d8afdd7c9e6aacc72d7262

back to top

Get-HmacHash

Gets an HMAC hash

Get-HmacHash
-Key <String>
-Value <String>
[<CommonParameters>]

Converts the string to a HMAC hash.

-Key

The key to used when hashing.

Type String
Position Named
Accepts pipeline input True (ByPropertyName)

-Value

The value to be hashed.

Type String
Position Named
Accepts pipeline input True (ByPropertyName)
Example
Get-HmacHash -Key (ConvertTo-Base64 -Value 123) -Value Bobby
# ex. aT03C0GzI3H7Ll1KvvIoXbMYYDBFIHl259q+sdaLoHc=

back to top

Invoke-UnitTests

Invokes unit tests in an assembly.

Invoke-UnitTests
-FilePath <String>
[-Filter] <String>
[-Random]
[-WhatIf]
[<CommonParameters>]

-FilePath

The path to the file containing the unit tests.

Type String
Accepts pipeline input False

-Filter

An optional parameter to filter the tests. You can filter on "ClassName.TestName".

Type String
Accepts pipeline input False

-Random

An optional parameter to randomize the tests.

Type SwitchParameter
Accepts pipeline input False
Example 1

Invokes all test.

Invoke-UnitTests 'C:\Workspace\UnitTests.dll'
Example 2

Invokes all test that match the provided filter.

Invoke-UnitTests 'C:\Workspace\UnitTests.dll' -Filter LoginTests
Example 3

Lists the test that would be processed if the command was executed.

Invoke-UnitTests 'C:\Workspace\UnitTests.dll' -WhatIf

back to top

Sync-Folder

Sync two folders.

Sync-Folder
-SourcePath <String>
-DestinationPath <String>
[-Force]
[-WhatIf]
[<CommonParameters>]

-SourcePath

The source path.

Type String
Accepts pipeline input False

-DestinationPath

The destination path.

Type String
Accepts pipeline input False

-Force

An optional flag to ignore errors and continue to process.

Type SwitchParameter
Accepts pipeline input False
Example

Syncs two folders.

Sync-Folder 'C:\Workspace\UnitTests.dll'

back to top

Visualization

Out-Chart

Displays a chart.

Out-Chart
-Data <OrderedDictionary>
-Type <ChartType>
[-Columns] <Int32>
[-Rows] <Int32>
[<CommonParameters>]

-Data

Type OrderedDictionary
Accepts pipeline input False

-Type

Type ChartType
Accepts pipeline input False

-Columns

Type Int32
Accepts pipeline input False

-Rows

Type Int32
Accepts pipeline input False
Example
Out-Chart -Type HorizontalBar -Data ([ordered] @{ "Item 1" = 30; "Item 2" = 10; "Item 3" = 3; "Item 4" = 40 }) -Columns 80
# ex.
# Item 1 ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
# Item 2 ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
# Item 3 ¦¦¦¦¦
# Item 4 ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦

back to top