11$PSDefaultParameterValues [" *:Force" ] = $true
22$PSDefaultParameterValues [" *:Confirm" ] = $false
3+ Push-Location / mnt/ c/ github/ dbatools.library
34
45if (Test-Path ./ lib) {
56 write-warning " removing ./lib"
@@ -9,15 +10,22 @@ if (Test-Path ./lib) {
910 rm - rf third- party- licenses
1011}
1112
12- $root = Split-Path - Path $PSScriptRoot
13+ $scriptroot = $PSScriptRoot
14+ if (-not $scriptroot ) {
15+ $scriptroot = " /mnt/c/github/dbatools.library/build"
16+ }
17+
18+ $root = Split-Path - Path $scriptroot
1319Push-Location " $root /project"
20+
21+
1422dotnet publish -- configuration release -- framework net6.0 | Out-String - OutVariable build
1523dotnet test -- framework net6.0 -- verbosity normal | Out-String - OutVariable test
1624Pop-Location
1725
1826Remove-Item - Path lib/ dbatools.xml
1927Get-ChildItem - Path lib/ net6.0 - File | Remove-Item
20- Move-Item - Path lib/ net6.0 / publish/* - Destination lib/ - ErrorAction Ignore
28+ Move-Item - Path lib/ net6.0 / publish/* - Destination lib/ # -ErrorAction Ignore
2129Remove-Item - Path lib/ net6.0 - Recurse - ErrorAction Ignore
2230
2331Get-ChildItem ./ lib - Recurse - Include * .pdb | Remove-Item
@@ -81,7 +89,7 @@ msiextract --directory $(Resolve-Path .\temp\xe) $(Resolve-Path .\temp\XESmartTa
8189
8290Get-ChildItem " ./temp/xe/*.dll" - Recurse | Copy-Item - Destination third- party/ XESmartTarget
8391Get-ChildItem " ./temp/dacfull/" - Include * .dll, * .exe, * .config - Recurse | Copy-Item - Destination ./ lib/ win
84- Get-ChildItem " ./temp/bogus/*/netstandard2 .0/bogus.dll" - Recurse | Copy-Item - Destination ./ third- party/ bogus/ bogus.dll
92+ Get-ChildItem " ./temp/bogus/*/net6 .0/bogus.dll" - Recurse | Copy-Item - Destination ./ third- party/ bogus/ bogus.dll
8593Copy-Item ./ temp/ LumenWorksCsvReader/ lib/ netstandard2.0 / LumenWorks.Framework.IO.dll - Destination ./ third- party/ LumenWorks/ LumenWorks.Framework.IO.dll
8694
8795Register-PackageSource - provider NuGet - name nugetRepository - Location https:// www.nuget.org/ api/ v2 - Trusted - ErrorAction Ignore
@@ -96,25 +104,26 @@ $parms = @{
96104}
97105
98106$parms.Name = " Microsoft.Data.SqlClient"
99- $parms.RequiredVersion = " 5.0 .1"
107+ $parms.RequiredVersion = " 5.1 .1"
100108$null = Install-Package @parms
101109
102110$parms.Name = " Microsoft.Data.SqlClient.SNI.runtime"
103- $parms.RequiredVersion = " 5.0.1 "
111+ $parms.RequiredVersion = " 5.1.0 "
104112$null = Install-Package @parms
105113
106114$parms.Name = " Microsoft.Identity.Client"
107- $parms.RequiredVersion = " 4.45 .0"
115+ $parms.RequiredVersion = " 4.53 .0"
108116$null = Install-Package @parms
109117
110- Copy-Item " $tempdir /nuget/Microsoft.Data.SqlClient.5.0 .1/runtimes/unix/lib/netcoreapp3.1 /Microsoft.Data.SqlClient.dll" - Destination lib
111- Copy-Item " $tempdir /nuget/Microsoft.Data.SqlClient.5.0 .1/runtimes/win/lib/netcoreapp3.1 /Microsoft.Data.SqlClient.dll" - Destination lib/ win- sqlclient/
112- Copy-Item " $tempdir /nuget/Microsoft.Identity.Client.4.45 .0/lib/netcoreapp2.1 /Microsoft.Identity.Client.dll" - Destination lib/ win- sqlclient/
113- Copy-Item " $tempdir /nuget/Microsoft.Data.SqlClient.SNI.runtime.5.0.1 /runtimes/win-x64/native/Microsoft.Data.SqlClient.SNI.dll" - Destination lib/ win- sqlclient/
118+ Copy-Item " $tempdir /nuget/Microsoft.Data.SqlClient.5.1 .1/runtimes/unix/lib/net6.0 /Microsoft.Data.SqlClient.dll" - Destination lib
119+ Copy-Item " $tempdir /nuget/Microsoft.Data.SqlClient.5.1 .1/runtimes/win/lib/net6.0 /Microsoft.Data.SqlClient.dll" - Destination lib/ win- sqlclient/
120+ Copy-Item " $tempdir /nuget/Microsoft.Identity.Client.4.53 .0/lib/net6.0 /Microsoft.Identity.Client.dll" - Destination lib/ win- sqlclient/ # Maybe this will be a problem, i dont know
121+ Copy-Item " $tempdir /nuget/Microsoft.Data.SqlClient.SNI.runtime.5.1.0 /runtimes/win-x64/native/Microsoft.Data.SqlClient.SNI.dll" - Destination lib/ win- sqlclient/
114122
115123Copy-Item ./ temp/ linux/* - Destination lib - Exclude (Get-ChildItem lib - Recurse) - Recurse - Include * .exe, * .config - Verbose
116124
117- Copy-Item " ./var/replication/*.dll" - Destination ./ lib/
125+ Copy-Item " ./var/misc/core/*.dll" - Destination ./ lib/
126+ Copy-Item " ./var/misc/both/*.dll" - Destination ./ lib/
118127Copy-Item " ./var/third-party-licenses" - Destination ./ - Recurse
119128
120129$linux = ' libclrjit.so' , ' libcoreclr.so' , ' libhostfxr.so' , ' libhostpolicy.so' , ' libSystem.Native.so' , ' libSystem.Security.Cryptography.Native.OpenSsl.so' , ' Microsoft.Win32.Primitives.dll' , ' sqlpackage' , ' sqlpackage.deps.json' , ' sqlpackage.dll' , ' sqlpackage.pdb' , ' sqlpackage.runtimeconfig.json' , ' sqlpackage.xml' , ' System.Collections.Concurrent.dll' , ' System.Collections.dll' , ' System.Console.dll' , ' System.Diagnostics.FileVersionInfo.dll' , ' System.Diagnostics.TraceSource.dll' , ' System.Linq.dll' , ' System.Memory.dll' , ' System.Private.CoreLib.dll' , ' System.Private.Xml.dll' , ' System.Reflection.Metadata.dll' , ' System.Runtime.dll' , ' System.Security.Cryptography.Algorithms.dll' , ' System.Security.Cryptography.Primitives.dll' , ' System.Threading.dll' , ' System.Threading.Thread.dll' , ' System.Xml.ReaderWriter.dll' , ' sqlpackage' , ' sqlpackage.deps.json' , ' sqlpackage.dll' , ' sqlpackage.pdb' , ' sqlpackage.runtimeconfig.json' , ' sqlpackage.xml'
@@ -125,17 +134,23 @@ Copy-Item -Path $sqlp.FullName -Destination ./lib/
125134Get-ChildItem - Directory - Path ./ lib | Where-Object Name -notin ' win-sqlclient' , ' x64' , ' x86' , ' win' , ' mac' , ' macos' | Remove-Item - Recurse
126135
127136Get-ChildItem ./ lib, ./ lib/ win, ./ lib/ mac | Where-Object BaseName -in (Get-ChildItem / opt/ microsoft/ powershell/ 7 ).BaseName - OutVariable files
128- Remove-Item $files - Recurse
137+
138+ if ($files ) {
139+ Remove-Item $files - Recurse
140+ }
141+
129142
130143if ($isLinux -or $IsMacOs ) {
131144 chmod + x ./ lib/ sqlpackage
132145 chmod + x ./ lib/ mac/ sqlpackage
133146}
134147
135148Get-ChildItem ./ lib/* .xml, ./ lib/* .pdb - Recurse - OutVariable xmlpdb
136- Remove-Item - Path $xmlpdb - Recurse - ErrorAction Ignore
149+ if ($xmlpdb ) {
150+ Remove-Item - Path $xmlpdb - Recurse - ErrorAction Ignore
151+ }
137152
138- Import-Module ./ dbatools.core.library.psd1
153+ # Import-Module ./dbatools.core.library.psd1
139154
140155<#
141156 if ((Get-ChildItem -Path C:\gallery\dbatools.library\core -ErrorAction Ignore)) {
0 commit comments