Was just trying this Command in PowerShell Core 6.1 and noticed while using it with the -As PSObject switch, it was failing. The command was unable to import the inline C# code for DBNullScrubber.
I know PowerShell Core isn't called out as supported. I'm just working on refactoring an internal module that uses this command quite often.
I was able to get this working by changing the following line.
This isn't really an issue, more of a suggestion if people are trying to convert this to PowerShell Core. (Keep in mind - i did not test this fully, just the -As PSObject switch)
Was just trying this Command in PowerShell Core 6.1 and noticed while using it with the -As PSObject switch, it was failing. The command was unable to import the inline C# code for DBNullScrubber.
I know PowerShell Core isn't called out as supported. I'm just working on refactoring an internal module that uses this command quite often.
I was able to get this working by changing the following line.
Add-Type -TypeDefinition $cSharp -ReferencedAssemblies 'System.Data', 'System.Xml' -ErrorAction stop
To
Add-Type -TypeDefinition $cSharp -ReferencedAssemblies 'System.ComponentModel.TypeConverter','System.Data', 'System.Data.Common', 'System.Xml', 'System.Management.Automation' -ErrorAction stop
This isn't really an issue, more of a suggestion if people are trying to convert this to PowerShell Core. (Keep in mind - i did not test this fully, just the -As PSObject switch)