Skip to content

Fix deployment on PS Gallery, default 'localhost' value, -ExpandResultForSingleComputer switch, formatting #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 3, 2023

Conversation

aetonsi
Copy link
Contributor

@aetonsi aetonsi commented Apr 3, 2023

Hi
i noticed that the script version published to the PS Gallery is actually not correct.
When you install- the script, a "1.11" version is checked out from the gallery. But that's not the real 1.11 version, it's actually version 1.10, but (for some reason) the script's comment-based help reports version 1.11. This means that all of the localhost logic that avoids opening a PS Session, is missing.

So, in this PR:

  • i increased the script version
  • i added a default localhost value for $ComputerName (it was already implemented, but with an if statement)
  • i added 127.0.0.1 as possible value for the local machine
  • i cleaned up the file's formatting (whitespace, braces, ecc) following Poshcode's "K&R/OTBS" style guide (used by the official VSCode Powershell extension)

Changes proposed in this pull request:

  • i added a -ExpandResultForSingleComputer switch parameter that allows for returning just the boolean value, IIF a single computer was specified; for multilple computers, it does nothing

How to test this code:

  • Test-PendingReboot.ps1 127.0.0.1
  • Test-PendingReboot.ps1 -ExpandResultForSingleComputer or (short version, as supported by Powershell/.NET) Test-PendingReboot.ps1' -Expand

Has been tested on (remove any that don't apply):

  • Powershell 5 and above
  • win 11 (i didn't alter the system calls so it should still work for any OS)

@adbertram adbertram merged commit 5352f21 into adbertram:master Apr 3, 2023
@aetonsi
Copy link
Contributor Author

aetonsi commented Apr 8, 2023

hi, could you please redeploy the script to PSGallery? i thought there was some automatic trigger that does it but apparently there isn't.. thanks!

@adbertram
Copy link
Owner

adbertram commented Apr 11, 2023 via email

@aetonsi
Copy link
Contributor Author

aetonsi commented Apr 13, 2023

Hi thanks for the reply.
I thought about making it a module but I see that in the gallery there's another package (a few actually, but only 1 with a lot of downloads) that does all of this and additionally gives detailed information.
So I will not make a new personal package on the gallery.
Regarding yours, maybe you could upload one last version to your package with the merged edits and make it clear that it's unmaintained/abandoned. Or pull the package from the gallery altogether. Or leave it as it is (but keep in mind that as i said the version in the gallery is somehow broken, being a "hybrid" in between 1.10 and 1.11).
Personally i will evaluate the aforementioned module and in case use that, or else, i'll keep using your script pulling it directly from github, avoiding the PSGallery version, so no automations for me :( (unless you publish a final, updated version).

thanks and have a nice day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants