Open AGirin opened 10 years ago
Others are commenting on the powershell version too, looks like this project requires 3.0 ... good reason to upgrade.
seems to be related to the implementation of PSUsing and invocations of Dispose() https://davewyatt.wordpress.com/2014/05/27/idisposable-and-powershell-versions/ Something more portable would be nice.
Thanks a lot for a great project! I found some issues with it though:
--> I was getting no such method Dispose() on Windows 2008 with PowerShell 2.0 installed here:
function PSUsing { param ( [System.IDisposable] $inputObject = $(throw "The parameter -inputObject is required."), [ScriptBlock] $scriptBlock = $(throw "The parameter -scriptBlock is required.") ) Try { &$scriptBlock } Finally { if ($inputObject -ne $null) { if ($inputObject.psbase -eq $null) { $inputObject.Dispose() } else { $inputObject.psbase.Dispose() <-------- No such method psbase.Dispose() in PowerShell 2.0 } } } }
I had to comment that line out to make module work.
--> Module was erroring on that line with PowerShell 2.0:
RootModule = 'Graphite-Powershell.psm1'
I had to replace it with:
ModuleToProcess = 'Graphite-Powershell.psm1'
All these issues go away if I upgrade to PowerShell 3.0 though.