Skip to content
Michael Panagos edited this page May 22, 2024 · 2 revisions

Introduction

PowerShell Module to Connect Scripts to Messaging Services (Email, Chat, etc.).

Messaging Services

This module currently supports:

Getting Started

Create Service Application

Most services (Microsoft 365, Google Workspace, etc.) require you to create or register applications to be able to use their APIs. Please see the wiki page for each supported service below for more information:

  1. Microsoft 365 (Wiki page coming soon!)
  2. Google Workspace (Wiki page coming soon!)

Installing ScriptMessage PowerShell Module

There are a number of different ways to install PowerShell modules. Adjust the directions below depending on your organization's needs and policies.

Option 1: Install From PowerShell Gallery

The ScriptMessage PowerShell Module is published on Microsoft's central repository for PowerShell content called the PowerShell Gallery. PowerShell comes with the PowerShellGet module, which is used to install packages from the PowerShell Gallery.

If you are running PowerShell 6 or higher, you have a usable version of PowerShellGet.

  • PowerShell 6.0 shipped with version 1.6.0 of PowerShellGet.
  • PowerShell 7.0 shipped with version 2.2.3 of PowerShellGet.

If you are running Windows PowerShell 5.1, you should install a newer version of PowerShellGet. More information from Microsoft is available here. For best results, you should always install the latest supported version.

Run one of the following commands from the PowerShell console of the version of PowerShell you will be using the module under:

<#
    Install the Latest Version in the Default Location
    In PowerShellGet 1.x versions, the default install location is AllUsers ($env:ProgramFiles\PowerShell\Modules), which requires elevation for install.
    In PowerShellGet versions 2.0.0 and above, the default is CurrentUser (PS Desktop: $home\Documents\WindowsPowerShell\Modules or PS Core: $home\Documents\PowerShell\Modules), which does not require elevation for install.
#>
Install-Module -Name ScriptMessage

# Specify the Location to Install
Install-Module -Name ScriptMessage -Scope AllUsers
Install-Module -Name ScriptMessage -Scope CurrentUser

# Specify an Older Version Example
Install-Module -Name ScriptMessage -RequiredVersion 1.0.5

# Update an Already Installed Module to the Latest Version
Update-Module -Name ScriptMessage

Option 2: Manually Install Module Files

Tip: Run the following command from the version of PowerShell you plan to use to see your specific module install locations:

$env:PSModulePath -split ';'
  1. Clone or download the repo.
  2. Since the file was downloaded from the internet, if necessary, unblock the ZIP file using Windows Explorer (right-click on the ZIP file and select Properties) or the Unblock-File cmdlet.
  3. Copy the ScriptMessage folder to the location you desire. Below are some example locations.
    • PowerShell Desktop (5.1)
      • Current User: [Environment]::GetFolderPath("MyDocuments")\WindowsPowerShell\Modules
      • All Users: $Env:ProgramFiles\WindowsPowerShell\Modules
    • PowerShell Core (6+)
      • Current User: [Environment]::GetFolderPath("MyDocuments")\PowerShell\Modules
      • All Users: $Env:ProgramFiles\PowerShell\Modules
      • All Users (Specific Version Example): $Env:ProgramFiles\PowerShell\7\Modules

Configure ScriptMessage PowerShell Module

Configuration File

Documentation coming soon!

Sample Script

Documentation coming soon!

Other Notes

Security

Documentation coming soon!

Troubleshooting

Documentation coming soon!