Skip to content

v1.4.2

Choose a tag to compare

@github-actions github-actions released this 25 Aug 19:54
· 27 commits to master since this release
2a5baad

Changed

Internal

Nothing here is observable from a sensor script: no cmdlet, parameter, default, output or
message text changed. The diff is large because files moved and one function became thirteen.
Scripts written for 1.0.0 and 1.1.0 keep running unchanged; there is nothing to migrate.

  • The private source is grouped by what each file serves: State, Storage, Secrets, Channel,
    Output and Doctor, instead of one flat folder. The file holding the output document is now
    named after it rather than after sensor state, which is a different concept in this module.

  • Every Doctor script check is its own function, file and test. The thirteen checks lived
    in one 281-line function. Each is now a private function named after its check code, the
    runner is a plain list of calls, and a new test file pins the check code, severity and full
    message text of every outcome. The messages are unchanged character for character, and a test
    fails if a check is written but never registered.

  • Six functions that were hiding inside files named after other functions have their own
    files
    , among them the resolver that decides where each on-disk store lives.

  • The Doctor's shared analysis is a parse context read through named private functions.
    Five helpers that were script-block locals inside one function are now ordinary functions, so
    a single check can be reached and stepped through on its own.

Fixed

  • A null output document now fails with a message that names the cause and the cmdlet.
    After Set-PrtgOutput $null, Add-PrtgChannel failed with "You cannot call a method on a
    null-valued expression"
    and Set-PrtgMessage with "The property 'text' cannot be found on
    this object"
    , neither naming the document or the cmdlet. Both now say which cmdlet failed,
    that the output document is null, and how to recover. They fail at exactly the point they did
    before: Set-PrtgOutput still accepts $null, Get-PrtgMessage still returns $null
    silently and Write-PrtgOutput still emits without error, because failing earlier could turn a
    green sensor red on upgrade.

  • Clear-PrtgSensorState -ClearLock -Force now always warns when it cannot remove the lock
    sidecar, not only inside an Invoke-PrtgSensor block.
    Remove-Item reports a failed delete
    as a non-terminating error, so the warning fired only under the Stop preference that
    Invoke-PrtgSensor sets; from a console or a maintenance script a raw
    RemoveFileSystemItemIOError surfaced instead, and setting $ErrorActionPreference in the
    calling script did not help because the cmdlet runs in the module's own session state. The
    removal now requests a terminating error explicitly, so every call path reports the same
    warning, which is the operator's only signal that the file is still held by a live run.