r/PowerShell • • Jul 29 '18

Announcing PS Sysadmin Toolkit

Fellow Powershellers!

A few days ago I came up with the idea for module that would be a Toolkit of useful functions for system administrators. I posted a request for ideas over in /r/sysadmin, and the response was fantastic.

I'm happy to report that development is well underway. If you'd like to review the module, you may do so here: https://github.com/steviecoaster/PSSysadminToolkit

If you have an idea for a function that could be added to the module, please file an issue, and if you have code already written, do share if you are able, and I'll get it added in. Rather post it in the issue and I'll handle the rest, or submit a PR for me to merge.

The Master branch is relatively empty at the moment, I've got everything in the Dev branch until things are built enough to warrant a Release, at which time, I'll push to Master.

Any and all feedback is most welcome, and an extra set of eyes/hands from you fine folks is more than welcome.

118 Upvotes

27 comments sorted by

View all comments

2

u/Lee_Dailey [grin] Jul 29 '18

howdy steviecoaster,

have you tested the Get-SystemUptime function? [grin]

New-Object : Cannot find type [System.Collections.Generic.List]: verify that the assembly containing this type is loaded. At line:14 char:22

  • $UptimeObjects = New-Object System.Collections.Generic.List
  •                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidType: (:) [New-Object], PSArgumentException

    • FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand

there are a lot of oddities in that bit of code. [grin] do you really want anything other than success OR a formal error? i tend to prefer to return "not found" sort of stuff, but others seem to pref feeding any errors to the error stream.

take care,
lee

2

u/[deleted] Jul 29 '18

Isn’t there an environmental variable for that already?

1

u/Lee_Dailey [grin] Jul 29 '18

howdy iwifia,

not on win7. [grin] i dunno about the new win versions, tho.

take care,
lee

2

u/[deleted] Jul 29 '18

If there is I haven't discovered it. And it doesn't give you results for both last boot and uptime.

1

u/Lee_Dailey [grin] Jul 29 '18

howdy steviecoaster,

yep, i thot it was unlikely. perhaps it exists on the 'nix OSs?

take care,
lee