Skip to content
On this page

Powershell script template for RMM and general use.

Recently I've been running Tactical RMM and luckily for most of my scripts I have taken an "RMM Agnostic" approach to my scripting techniques. From using that technique a type of template has emerged which I will immortalize here.

Powershell Script Template

    Write a basic summary of the script.
    Write a detailed description of the script.
    Example script usage here. Use multiple .EXAMPLE annotation for multi usage.
    Write detailed inscrutions here for setup/rmm usage.
   Creation Date:


function Script_Full_Name {

    Begin {
        [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
        #Do script setup/checks for services/software and folder creation here

    Process {
        Try {
            #Main Script Process here
        Catch {
            $exception = $_.Exception
            Write-Output "Error: $exception"

    End {
        #Script cleanup and final checks here
        #Check for last errors and exit
        if($error) {
            Exit 1

        Exit 0

if (-not(Get-Command 'Script_Full_Name' -errorAction SilentlyContinue)) {
    . $MyInvocation.MyCommand.Path
$scriptArgs = @{
    MyParam1 = $MyParam1
Script_Full_Name @scriptArgs