A robust PowerShell tool that automatically generates Action1-compatible wrapper scripts for existing .ps1 files.
The generated wrapper safely bypasses @Action1Corp’s script-flattening, parameter-injection quirks, and syntax corruption by embedding the original script as Base64 and reconstructing it at runtime.
This enables any PowerShell script - including complex installers, automation tools, and enterprise logic - to run reliably inside Action1.
So now it’s not just Action1: Patching That Just Works, but also Action1: Scripts That Just Work, thanks to ZyntriOps (comming soon).
Download URL: https://gists.mickert.dev/d76e6a710a6cafb5b631049f6aa917e4#file-new-a1wrapper-ps1
Latest README: https://gists.mickert.dev/d76e6a710a6cafb5b631049f6aa917e4#file-readme-md
.\New-A1Wrapper.ps1 -InputScriptPath .\MyScript.ps1.\New-A1Wrapper.ps1 -InputScriptPath .\MyScript.ps1 -OutputWrapperPath .\Wrapped.ps1Just paste the wrapper into an Action1 "Run PowerShell Script" job - no changes needed.
-
AST-based parameter discovery
Automatically extracts the top-levelparam()block using the PowerShell parser, even in scripts with PSScriptInfo headers, CmdletBinding, or nested scopes. -
Action1-safe parameter handling
Converts Action1’s injected variables (${ParamName}) into real PowerShell variables and normalizes boolean-like values. -
Base64 embedding
The original script is embedded as Base64 and reconstructed at runtime, making it immune to Action1’s script flattening and syntax corruption. -
Consistent logging
The wrapper logs:- the wrapper banner
- the original script name
- all arguments as JSON
- a timestamped execution line
-
Automatic output path
If no output path is provided, the wrapper is written to:<InputScriptPath>_Action1-wrapper.ps1 -
No param(), no $args, no multiline comments
The wrapper avoids all constructs that Action1 breaks. -
Production-ready
Designed for enterprise automation, RMM platforms, and CI/CD pipelines.
The generator performs the following steps:
- Resolves the input script path to an absolute path (required for AST + file IO).
- Parses the script using the PowerShell AST engine.
- Extracts the top-level
param()block (ignoring functions/classes). - Base64-encodes the entire original script.
- Generates a wrapper that:
- reads Action1-injected variables
- normalizes boolean-like values
- builds a hashtable of arguments
- logs execution metadata
- decodes the Base64 script into
$env:TEMP - executes the script with splatting
- returns the original exit code
The result is a wrapper that runs reliably inside Action1, regardless of how complex the original script is.
.\New-A1Wrapper.ps1 -InputScriptPath .\ZyntriOps-SmartmontoolsInstaller.ps1Works too - the wrapper simply passes an empty argument set.
.\New-A1Wrapper.ps1 -InputScriptPath C:\Scripts\Deploy.ps1.\New-A1Wrapper.ps1 -InputScriptPath .\Deploy.ps1 -OutputWrapperPath .\Deploy-A1.ps1When executed inside Action1, the wrapper prints:
ZyntriOps Action1 PowerShell Wrapper
Licensed under Apache License 2.0
Copyright (c) 2026 Michel Sijmons
Wrapper generator download: https://gists.mickert.dev/
[2026-03-04T12:56:15.2559329+01:00] Executing wrapped script 'ZyntriOps-SmartmontoolsInstaller.ps1' with arguments: {"Cleanup":true,"Json":true}
This makes debugging and auditing extremely easy.
- Windows 10/11 or Windows Server 2016+
- PowerShell 5.1 or PowerShell 7+
- Administrator privileges (only required if the wrapped script needs it)
- Action1 RMM (for execution)
The generated wrapper contains:
| Section | Purpose |
|---|---|
| ZyntriOps banner | Branding + licensing |
| Action1 variable import | Reads ${ParamName} |
| Boolean normalization | Converts "1"/"0" to $true/$false |
| Argument hashtable | Builds splatting dictionary |
| Logging | Timestamp + JSON args |
| Base64 decode | Writes original script to $env:TEMP |
| Execution | Runs original script with & $scriptPath @callArgs |
| Exit code propagation | Returns original exit code |
| Scenario | Result |
|---|---|
| Script with PSScriptInfo | ✔ |
| Script with CmdletBinding | ✔ |
| Script with nested functions | ✔ |
| Script with multiple param() blocks | ✔ (top-level only) |
| Script with no parameters | ✔ |
| Script with complex logic | ✔ |
| Action1 flattening | ✔ |
| Action1 variable injection | ✔ |
| Action1 syntax corruption | ✔ (Base64 bypass) |
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
If this tool saved you time, solved a headache, or helped you automate something cleanly inside Action1, consider supporting my work:
-
Explore my projects:
https://gists.mickert.dev/ • https://github.mickert.dev/ -
Support via Ko-fi:
https://support.mickert.dev/ • https://ko-fi.com/michelsprojects
Your support helps me build more tools like this.
Kind regards,
Michel Sijmons
https://mickert.dev