Closed SwarfegaGit closed 7 years ago
Weird. All objects should have GetType()
, it's defined on the root object
class of .NET. I'd say that this is probably a PowerShell Remoting bug that existed in v2, and they fixed in later versions.
Possibly. Despite these scripts running locally I am literally lifting and shifting them to a local machine, so a PSSession is still being created to itself when ran locally. I can't figure out a way to make one test.ps1 file that will be user friendly when ran locally or remote.
Happy to get this issue ignored if you're happy it's a v2 bug.
I assume that the issue can be closed now. Feel free to reopen if you need more assistance.
My management server runs PS v5. Target servers mostly run v2. From the management server I can do tests with Enter-PSSession fine but if I copy the Pester module to a server running PS v2 and run the tests directly from the server I get errors.
The test is...
It also fails on
With the same error...
RuntimeException: Method invocation failed because [Deserialized.System.IO.FileInfo] doesn't contain a method named 'GetType'.
Each time I am using the "Not BeNullOrEmpty". The rest of my tests don't use Not so possibly why only these two tests are failing?