MattHodge / Graphite-PowerShell-Functions

A group of PowerShell functions that allow you to send Windows Performance counters to a Graphite Server, all configurable from a simple XML file.
https://hodgkins.io/using-powershell-to-send-metrics-graphite
GNU General Public License v3.0
218 stars 71 forks source link

PowerShell Versions #31

Open ikkaro opened 9 years ago

ikkaro commented 9 years ago

Hi Matt,

It seems that the module doesn't works fine in Powershell v2.0 because of the method IsNullOrWhitespace and others, could that to be fixed or add a copy of the functions for PowerShell 2.0.

http://blog.danskingdom.com/powershell-2-0-vs-3-0-syntax-differences-and-more/

christrotter commented 9 years ago

Also confirming this - runs fine under 3.0, but not 2.0. Not a biggie, gives us a reason to upgrade to 3.0.

daks commented 9 years ago

In fact, it needs PowerShell v3. Maybe adding the information in the README could be useful, or just a check in the code.

Something like

if ($host.version.major -lt 3) {
   write-host You need at least version 3 of Powershell.
   Exit
}

I could add it to the code, but I don't know where to put it for a module.

toni-moreno commented 8 years ago

Hi @MattHodge , @ikkaro , @daks , there is any tested workarround which enable us run this tool ok in Powershell v2 ?

MattHodge commented 8 years ago

I am pretty sure someone made a fork which supported v2. Cannot find it though :/

gsmaul commented 8 years ago

The fork that supports v2 is located here: https://github.com/ashishpandey/Graphite-PowerShell-Functions