The Win10.ps1 script currently loads the preset file with:
# Load tweak names from the preset file
Get-Content $preset -ErrorAction Stop | ForEach-Object { AddOrRemoveTweak($_. Split("#")[0].Trim()) }
If the preset file could not be found or was somehow malformed, -ErrorAction Stop at least causes the script to halt execution, but the script still exits with code 0, so it can "look" like a successful run.
I'm running this script via Ansible, and for some while it was noop'ing on account of this behavior. It would be nice if the script could return with a non-zero code so that other scripts could detect this failure.
Sorry, normally I'd just submit a PR, but I'm pretty inexperienced with PowerShell and I don't know the best way to implement this behavior.
The
Win10.ps1
script currently loads the preset file with:If the preset file could not be found or was somehow malformed,
-ErrorAction Stop
at least causes the script to halt execution, but the script still exits with code0
, so it can "look" like a successful run.I'm running this script via Ansible, and for some while it was noop'ing on account of this behavior. It would be nice if the script could return with a non-zero code so that other scripts could detect this failure.
Sorry, normally I'd just submit a PR, but I'm pretty inexperienced with PowerShell and I don't know the best way to implement this behavior.
Thanks!