https://github.com/heyitsgilbert/psmotd
A Message of the Day (MOTD) for your PowerShell profile.
https://github.com/heyitsgilbert/psmotd
Last synced: about 1 year ago
JSON representation
A Message of the Day (MOTD) for your PowerShell profile.
- Host: GitHub
- URL: https://github.com/heyitsgilbert/psmotd
- Owner: HeyItsGilbert
- License: mit
- Created: 2024-04-23T05:00:22.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-23T00:29:45.000Z (over 1 year ago)
- Last Synced: 2025-01-11T08:48:53.459Z (about 1 year ago)
- Language: PowerShell
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# PSMotd
A Message of the Day (MOTD) for your PowerShell profile.
## Overview
This module allows you to write a function in your profile and call it a cadence
that you prefer. This is commonly something you want on first login or maybe
once a day.
## Installation
```powershell
Install-Module PSMotd
```
## Examples
An example of printing weather alerts in CA by defining a function called
`Get-MessageOfTheDay`. When the module is loaded it will determine if it should
run the function in your prompt.
```powershell
function Get-MessageOfTheDay {
$weatherAlerts = Invoke-RestMethod "https://api.weather.gov/alerts/active?area=CA"
if($weatherAlerts.features){
Write-Host "Weather Alerts in California 🌤️"
$weatherAlerts.Features | ForEach-Object{
Write-Host "== $($_.headline) =="
Write-Host "Severity: $($_.severity)"
Write-Host "Description: $($_.description)"
}
}
}
Import-Module PSMotd
Get-Motd
```
By default the MOTD will be print once a day. You can set your environment
variable to any of the following: 'Never', 'EverySession', 'Daily', 'Weekly'
## Configuration
Configurations can be seen via `Get-MOTDConfig` and updated with
`Set-MOTDConfig`.
You can set your MOTD frequency by running:
```powershell
```
## Shout Out
This is mostly a copy paste of DeadlyDog's tiPS module. It is a way more robust
framework, you should go and try it and buy him a bagel.