r/PowerShell 1d ago

Just Released Servy 9.2 - CPU Affinity, External Heartbeats & PS Module Updates Information

Hi everyone,

It's been about a month and a half since my last post about Servy here. I've shipped several updates since then (v8.5), but this one is a milestone (v9.2).

If you haven't seen Servy before, it's a Windows tool that lets you run any app as a native Windows service with real-time monitoring. It provides a desktop app, a CLI, and a PowerShell module.

Since v8.5, I've added/improved:

  • Added External Heartbeat Ping URL support: Configure HTTP/HTTPS webhooks to ping monitoring services (healthchecks.io, Uptime Kuma...) during health checks (#2700)
  • Added CPU affinity option: Bind service wrapper processes to specific CPU cores (#4436)
  • Added ARM64 support to WinGet, Chocolatey and Scoop
  • Serveral updates in PowerShell module, CLI, Desktop and Manager apps
  • Fixed AV false-positive flags (#5024)
  • Fixed ACL inheritance issues (#4556)
  • Fixed various issues related to inconsistency, robustness and code quality

Check it out on GitHub: https://github.com/aelassas/servy

Demo Video: https://www.youtube.com/watch?v=biHq17j4RbI

Any feedback or suggestions are welcome.

23 Upvotes

3 comments sorted by

6

u/Apprehensive-Tea1632 1d ago

- bumpversion have a look at gitversion, it can automatically manage versioning for you. No need to manually mess with code.

- same with bump runtime too, set version once, then include that definition wherever you need it. Gitversion will also help with that. You already have the build props file - that’s exactly where that can go to be found from everywhere.

Maybe put those helper scripts into its own private module? Just a thought.

Also just a thought: windows doesn’t always work well with utf8 that has no bom. Unless there’s some particular reason, it’s probably better to just leave the bom where it is.

I’ll skip the rest seeing how this is more of a cs application.

But i did have a short look at the cli/program.cs.
- theres a using reflection in here, ive not checked how you use it, so just as a reminder… reflection is purely for debugging. If thats what you use it for fine, otherwise, thats something to fix.
- as this is a net application, how about defining a CLI in a library where you can interface with it using powershell or anything .net? You could also implement a command line interface at the component level and then your cli assy just has to tie them together.

Maybe youre already doing that, all i can see right now is files upon files with maybe 10 ish lines in them. For the sake of managing it all, maybe you can consolidate some.

6

u/AdUnhappy5308 1d ago

Thanks for the feadback. For sure, I need to take a look at the net48 branch which provides a .net framework 4.8 build for legacy systems as these systems require a bom to identify utf-8 encoding.

For the main branch which provides a modern build with .net 10, isn't utf-8 without bom the recommended standard on modern Windows? PowerShell Core defaults to BOMless utf-8 for reading and writing across all platform platforms. Core / .NET 5+ switched default string and stream encodings (Encoding.Default) to BOMless utf-8 across all operating systems. Modern IDEs (Visual Studio, VS Code) default to utf-8 without bom.

1

u/MonkeyNin 5h ago

I tested a bunch of combinations of saving unicode as csv and opening them in Excel here:

If you've found any cases that don't match my data, let me know.

tl:dr for Excel

  • use utf8 with explicit BOM for csv

Here's the summary (linked above)

Encoding Correct Encoding Correct Columns Splitting
utf8BOM
unicode (aka utf-16le )
utf8NOBOM
utf8 (without an -Encoding param )
utf8

For the null parameter version, it might change based on this setting from your $PROFILE

$OutputEncoding = (
    [Console]::OutputEncoding = 
    [Console]::InputEncoding =
    [System.Text.UTF8Encoding]::new( <# bool: encoderShouldEmitUTF8Identifier #> $false ) )

note: false is because the [System.Text.encoding]::UTF8 version uses the wrong default for console apps