Exported Commands

Command documentation generated by GitHub Actions, stored in docs/.

Get-Greeting

Get-Greeting

Synopsis

Gets a personalised greeting message.

Description

This function creates a friendly greeting message for the specified person. It can optionally include the current time in the greeting.

Syntax

Get-Greeting [-Name <String>] [-IncludeTime] [-Verbose] [-Debug] [-ErrorAction <ActionPreference>] [-WarningAction <ActionPreference>] [-InformationAction <ActionPreference>] [-ProgressAction <ActionPreference>] [-ErrorVariable <String>] [-WarningVariable <String>] [-InformationVariable <String>] [-OutVariable <String>] [-OutBuffer <Int32>] [-PipelineVariable <String>]

Parameters

-Name

The name of the person to greet. This parameter is mandatory.

  • Type: String
  • Required: true
  • Position: 1
  • Default value: None
  • Accepts pipeline input: false

-IncludeTime

When specified, includes the current time in the greeting message.

  • Type: SwitchParameter
  • Required: false
  • Position: named
  • Default value: False
  • Accepts pipeline input: false

Examples

Example 1

Returns: “Hello Alice, how are you today?”

Get-Greeting -Name "Alice"

Example 2

Returns: “Hello Bob, how are you today? The time is 14:30:25”

Get-Greeting -Name "Bob" -IncludeTime
Invoke-ClassDemo

Invoke-ClassDemo

Synopsis

Demonstrates the use of both PowerShell and C# classes.

Description

This function showcases the SimpleCalculator PowerShell class and StringHelper C# class by performing basic operations and returning the results in a formatted object.

Syntax

Invoke-ClassDemo [[-FirstNumber <Int32>]] [[-SecondNumber <Int32>]] [[-TestString <String>]] [-Verbose] [-Debug] [-ErrorAction <ActionPreference>] [-WarningAction <ActionPreference>] [-InformationAction <ActionPreference>] [-ProgressAction <ActionPreference>] [-ErrorVariable <String>] [-WarningVariable <String>] [-InformationVariable <String>] [-OutVariable <String>] [-OutBuffer <Int32>] [-PipelineVariable <String>]

Parameters

-FirstNumber

The first number for the calculation. Default is 10.

  • Type: Int32
  • Required: false
  • Position: 1
  • Default value: 10
  • Accepts pipeline input: false

-SecondNumber

The second number for the calculation. Default is 5.

  • Type: Int32
  • Required: false
  • Position: 2
  • Default value: 5
  • Accepts pipeline input: false

-TestString

The string to manipulate using the C# StringHelper class. Default is “Hello World”.

  • Type: String
  • Required: false
  • Position: 3
  • Default value: Hello World
  • Accepts pipeline input: false

Examples

Example 1

Uses default values to demonstrate both classes.

Invoke-ClassDemo

Example 2

Performs calculations with 20 and 8, and manipulates the string “PowerShell Rocks”.

Invoke-ClassDemo -FirstNumber 20 -SecondNumber 8 -TestString "PowerShell Rocks"
Set-SimpleMessage

Set-SimpleMessage

Synopsis

Sets a simple message to display.

Description

This function allows you to set a custom message that can be displayed. The message is returned as output and can be stored or displayed as needed.

Syntax

Set-SimpleMessage [-Message <String>] [-ToUpper] [-Verbose] [-Debug] [-ErrorAction <ActionPreference>] [-WarningAction <ActionPreference>] [-InformationAction <ActionPreference>] [-ProgressAction <ActionPreference>] [-ErrorVariable <String>] [-WarningVariable <String>] [-InformationVariable <String>] [-OutVariable <String>] [-OutBuffer <Int32>] [-PipelineVariable <String>]

Parameters

-Message

The message text to set. This parameter is mandatory.

  • Type: String
  • Required: true
  • Position: 1
  • Default value: None
  • Accepts pipeline input: false

-ToUpper

When specified, converts the message to uppercase before returning it.

  • Type: SwitchParameter
  • Required: false
  • Position: named
  • Default value: False
  • Accepts pipeline input: false

Examples

Example 1

Returns: “Welcome to PowerShell”

Set-SimpleMessage -Message "Welcome to PowerShell"

Example 2

Returns: “HELLO WORLD”

Set-SimpleMessage -Message "hello world" -ToUpper