PowerShell scripts for Datto RMM with embedded functions for easy maintenance and deployment.
| Task | Location | Documentation |
|---|---|---|
| Find scripts | components/ |
Component Categories |
| Create scripts | templates/ |
Templates |
| Copy functions | shared-functions/ |
Function Reference |
| Deploy | Direct paste to RMM | Deployment Guide |
| Download files | Modern patterns | Download Best Practices |
- Flexible Architecture: Support for both embedded functions and standard module imports.
- Direct Deployment: Scripts are designed to be deployed directly to Datto RMM components.
- Standardized Logging: Consistent logging using
Write-RMMLog(orWrite-Hostfor Monitors).
Scripts can use embedded functions for easy maintenance or standard PowerShell modules where appropriate.
# Example embedded function (copied from shared-functions/)
function Write-RMMLog {
param([string]$Message, [string]$Level = 'Info')
Write-Output "[$Level] $Message"
}- ✅ Copy functions from
shared-functions/library (for maintainability) - ✅ Create custom functions when shared functions don't fit your needs
- ✅ Use PowerShell modules (
Import-Module) when appropriate - ✅ Download installers/resources from vendors (Adobe, Microsoft, etc.)
- ❌ Avoid launcher scripts that pull other scripts from external sources (GitHub wikis, etc.)
For Datto RMM Custom Monitors, output must follow this exact contract so RMM parses results reliably:
- Use Write-Host exclusively (no Write-Output/Write-Verbose)
- Emit exactly one diagnostic section:
- "<-Start Diagnostic->" ... "<-End Diagnostic->"
- Emit exactly one result section immediately after diagnostics:
- "<-Start Result->"
- A single line beginning with "Status=..."
- "<-End Result->"
- Exit code: 0 for OK, non-zero for alert states
Minimal example:
# Diagnostics
Write-Host '<-Start Diagnostic->'
Write-Host 'My Monitor: running checks...'
Write-Host '<-End Diagnostic->'
# Results (single line)
Write-Host '<-Start Result->'
Write-Host 'Status=OK: All checks passed'
Write-Host '<-End Result->'
exit 0Recommended helper pattern (centralized):
function Write-MonitorAlert { param([string]$Message)
Write-Host '<-End Diagnostic->'
Write-Host '<-Start Result->'
Write-Host "Status=$Message"
Write-Host '<-End Result->'
exit 1
}
function Write-MonitorSuccess { param([string]$Message)
Write-Host '<-End Diagnostic->'
Write-Host '<-Start Result->'
Write-Host "Status=$Message"
Write-Host '<-End Result->'
exit 0
}components/
├── Applications/ # Software deployment scripts
├── Monitors/ # System monitoring scripts
└── Scripts/ # General automation scripts
shared-functions/ # Function patterns to copy/paste
templates/ # Script templates
docs/ # Documentation
ScanSnapHome.ps1- ScanSnap Home installation
FocusedDebloat.ps1- Windows bloatware removalSetup-TestDevice.ps1- Test device configuration
SelfContainedApplication-Template.ps1- Application script templateSelfContainedScript-Template.ps1- General script templateDirectDeploymentMonitor-Template.ps1- Monitor script template
- Copy script content from
components/ - Paste directly into Datto RMM component
- Set environment variables as needed
- Deploy
Start new work by reviewing the core guides in docs/ so your scripts align with the project conventions:
- Function Reference - Embedded helper functions and patterns
- Deployment Guide - Packaging and releasing components
- Component Categories - Picking the right Datto RMM template
- Monitor Development Guidelines - Output contract and testing for monitors
- Download Best Practices - Managing external installers
- File Attachment Guide - Datto RMM copies attached files into the script working directory, so reference them directly by name (no temp paths required)