Get-MOTD
SYNOPSIS
Retrieve and display a Message of the Day (MOTD) with system information.
SYNTAX
Get-MOTD [[-ComputerName] <String[]>] [[-Credential] <PSCredential>] [[-Color] <ConsoleColor>] [-RandomColor]
[-ShowTimer] [<CommonParameters>]
DESCRIPTION
This function retrieves and displays a Message of the Day (MOTD) containing system information such as hostname, IP address, operating system details, uptime, memory usage, disk usage, and more. It supports remote execution, custom colors, random colors, and an optional timer to measure execution time.
EXAMPLES
EXAMPLE 1
Displays the MOTD for the local computer.
EXAMPLE 2
Displays the MOTD for the remote computer "Server01" using the specified credentials.
EXAMPLE 3
Displays the MOTD for the local computer with a random color and shows the processing time.
PARAMETERS
-ComputerName
The name of the computer(s) to retrieve the MOTD for. Defaults to the local computer.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
-Credential
The credentials to use for remote connections.
Type: PSCredential
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Color
The color to use for displaying the MOTD. Defaults to 'Cyan'.
Type: ConsoleColor
Parameter Sets: (All)
Aliases:
Accepted values: Black, DarkBlue, DarkGreen, DarkCyan, DarkRed, DarkMagenta, DarkYellow, Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow, White
Required: False
Position: 3
Default value: Cyan
Accept pipeline input: False
Accept wildcard characters: False
-RandomColor
A switch to use a random color for displaying the MOTD.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-ShowTimer
A switch to display the time taken to process the MOTD.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.