Skip to content
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

Error with old Versions of Windows / PowerShell #9

Open
akwitt opened this issue Nov 28, 2023 · 0 comments
Open

Error with old Versions of Windows / PowerShell #9

akwitt opened this issue Nov 28, 2023 · 0 comments

Comments

@akwitt
Copy link

akwitt commented Nov 28, 2023

Thanks for this useful check!

On older systems there is no Get-LocalGroupMember Cmdlet - the check will crash with ValueError ('summary' must be non-empty str or None, got )
This PS module seems to come with Version 5.1 (WMF 5.1)

I propose two solutions:

  1. write a routine using WMIC if the Cmdlet is not found (not worth it in my opinion)
  2. let the script return an error code if (Get-Host).Version -lt [System.Version]"5.1" or maybe (Get-Command Get-LocalGroupMember -ErrorAction SilentlyContinue) -eq $null

Could do a PR if you want but I am new to custom plugins and don't want to break anything

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

No branches or pull requests

1 participant