Skip to content

Commit

Permalink
Merge pull request #5543 from Hvid/dbnullscrubber-core
Browse files Browse the repository at this point in the history
Fix Invoke-DbaAsync.ps1 for Powershell Core.
  • Loading branch information
potatoqualitee committed May 16, 2019
2 parents 3029274 + 4114060 commit 1acaf8d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/functions/Invoke-DbaAsync.ps1
Expand Up @@ -136,7 +136,12 @@ function Invoke-DbaAsync {
'@

try {
Add-Type -TypeDefinition $cSharp -ReferencedAssemblies 'System.Data', 'System.Xml' -ErrorAction stop
if ($PSEdition -eq 'Core') {
$assemblies = @('System.Management.Automation', 'System.Data.Common', 'System.ComponentModel.TypeConverter')
} else {
$assemblies = @('System.Data', 'System.Xml')
}
Add-Type -TypeDefinition $cSharp -ReferencedAssemblies $assemblies -ErrorAction stop
} catch {
if (-not $_.ToString() -like "*The type name 'DBNullScrubber' already exists*") {
Write-Warning "Could not load DBNullScrubber. Defaulting to DataRow output: $_."
Expand Down

0 comments on commit 1acaf8d

Please sign in to comment.