Repository navigation
v1.1.0
All changes are strictly additive: no existing cmdlet, parameter, default, or output
shape changed. Sensors written against 1.0.0 behave identically after upgrading.
Added
Invoke-PrtgSensor -DryRun: returns the sensor result as an inspectable
PSCustomObjectinstead of the PRTG JSON string, for debugging in a normal console.
Errors are rethrown with full details instead of being flattened into a PRTG error
response. (Examples/18)Invoke-PrtgSensor -RetryCount/-RetryDelaySeconds: re-runs a throwing script
block up to N additional times with an optional pause. Output state is cleared before
every attempt. Success after retries appends(n/max retries attempted)to the sensor
message; total failure prefixes the error text withunsuccessful after N retries:.
(Examples/19)Invoke-PrtgSensor -ForceModernTls: switches the process to TLS 1.2 (plus TLS 1.3
when the runtime supports it) before the block runs. Replaces the manual
[Net.ServicePointManager]one-liner Windows PowerShell 5.1 web requests needed.
(Examples/22)Save-PrtgSensorState/Get-PrtgSensorState/Clear-PrtgSensorState: persist
arbitrary data between sensor runs (caching, deltas, rates). Entries carry UTC
timestamps;-MaxAgefilters or prunes by age,-Latestreturns the newest bare
value,-MaxEntriescaps history growth. Reads and writes are serialized with an
exclusive, crash-safe file lock (-TimeoutSecondsto bound the wait,-Forceto
bypass,Clear-PrtgSensorState -ClearLockto remove the lock sidecar).
(Examples/20)Invoke-PrtgSensorDoctor: static analysis (AST only, never executes the script) plus
environment diagnosis for sensor scripts. Ten script checks (PSK0001-PSK0010: syntax,
import order, Restart-* placement, manual output calls inside the block, multiple or
missingInvoke-PrtgSensor, trailing output, missing TLS setup, leftover-DryRun)
and four environment checks (PSK0101-PSK0104: PrtgSensorKit and dependency modules
resolvable in the 32-bit / 64-bit / pwsh hosts the sensor actually runs in). Prints a
colored summary and returns one finding object per check.
(Examples/21)- Integration sensors under
Tests/Integration/(working, failing, and malformed
categories) for manual end-to-end validation on a real PRTG probe before a release, with
a validation matrix mapping each script to its expected PRTG result and
Invoke-PrtgSensorDoctorverdict.
Changed
- README: new sections for state between runs, retries,
-DryRundebugging, and the
sensor doctor; the TLS tip now recommends-ForceModernTls. - Module manifest
ReleaseNotespoints atCHANGELOG.mdso the PowerShell Gallery page
links to the full history.