Closed joalcorn closed 2 years ago
@joalcorn -- can you confirm which version of Powershell you are using when using powershell.exe -- I know that PS v4 doesn't like to play nice with the '::new()' syntax. But PS v5.1 does.
Please run $PSVersionTable
and post the results here.
As an aside, this module has never intended to be compatible with versions of PowerShell prior to v5.
@mithrandyr I am using PowerShell 5.1.
Here is the output of $PSVersionTable
as requested.
Name Value
---- -----
PSVersion 5.1.17763.2090
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.2090
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
The fix I submitted for this issue is to move from using the New-Object
cmdlet to using the ::new()
constructor off the type accelerator when instantiating the $Messages
member of the ProviderBase
class, which is what I committed in my pull request.
Using
New-Object
with the string type specified in the property instantiation for$Messages
caused errors when working in PowerShell.exe and not in the ISE. The error avoided is:This has only been tested with PowerShell 5.1 on WIndows 10 LTSC, build 1809