iRon7 / Join-Object

Combines two objects lists based on a related property between them.
MIT License
107 stars 13 forks source link

Cannot dot source / invoke script on 2012 R2 #5

Closed chaoscreater closed 5 years ago

chaoscreater commented 5 years ago

I can invoke it on Win10 but not on Windows Server 2012 R2:

image

meany commented 5 years ago

I also ran into this issue, and after debugging I found the underlying error to be this:

Method invocation failed because [System.Management.Automation.CommandMetadata] doesn't contain a method named 'New'.
At line:344 char:3
+         $MetaData = [System.Management.Automation.CommandMetadata]::New($Command)
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

I updated line 344 to be this based on another example I found:

$MetaData = [System.Management.Automation.CommandMetadata] $Command

And it worked. I'll create a PR.

meany commented 5 years ago

7

iRon7 commented 5 years ago

@chaoscreator, @meany, Sorry for the late response (as owner, I didn't get any notifications of the issues playing). Thanks you for the feedback, I will merge this in the master branch soon.

iRon7 commented 5 years ago

@ChaosCreator, @meany, Thanks again for the feedback, I have uploaded a new version with this change.