1
1
$PSDefaultParameterValues [" *:Force" ] = $true
2
2
$PSDefaultParameterValues [" *:Confirm" ] = $false
3
+ Push-Location / mnt/ c/ github/ dbatools.library
3
4
4
5
if (Test-Path ./ lib) {
5
6
write-warning " removing ./lib"
@@ -9,15 +10,22 @@ if (Test-Path ./lib) {
9
10
rm - rf third- party- licenses
10
11
}
11
12
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
13
19
Push-Location " $root /project"
20
+
21
+
14
22
dotnet publish -- configuration release -- framework net6.0 | Out-String - OutVariable build
15
23
dotnet test -- framework net6.0 -- verbosity normal | Out-String - OutVariable test
16
24
Pop-Location
17
25
18
26
Remove-Item - Path lib/ dbatools.xml
19
27
Get-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
21
29
Remove-Item - Path lib/ net6.0 - Recurse - ErrorAction Ignore
22
30
23
31
Get-ChildItem ./ lib - Recurse - Include * .pdb | Remove-Item
@@ -81,7 +89,7 @@ msiextract --directory $(Resolve-Path .\temp\xe) $(Resolve-Path .\temp\XESmartTa
81
89
82
90
Get-ChildItem " ./temp/xe/*.dll" - Recurse | Copy-Item - Destination third- party/ XESmartTarget
83
91
Get-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
85
93
Copy-Item ./ temp/ LumenWorksCsvReader/ lib/ netstandard2.0 / LumenWorks.Framework.IO.dll - Destination ./ third- party/ LumenWorks/ LumenWorks.Framework.IO.dll
86
94
87
95
Register-PackageSource - provider NuGet - name nugetRepository - Location https:// www.nuget.org/ api/ v2 - Trusted - ErrorAction Ignore
@@ -96,25 +104,26 @@ $parms = @{
96
104
}
97
105
98
106
$parms.Name = " Microsoft.Data.SqlClient"
99
- $parms.RequiredVersion = " 5.0 .1"
107
+ $parms.RequiredVersion = " 5.1 .1"
100
108
$null = Install-Package @parms
101
109
102
110
$parms.Name = " Microsoft.Data.SqlClient.SNI.runtime"
103
- $parms.RequiredVersion = " 5.0.1 "
111
+ $parms.RequiredVersion = " 5.1.0 "
104
112
$null = Install-Package @parms
105
113
106
114
$parms.Name = " Microsoft.Identity.Client"
107
- $parms.RequiredVersion = " 4.45 .0"
115
+ $parms.RequiredVersion = " 4.53 .0"
108
116
$null = Install-Package @parms
109
117
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/
114
122
115
123
Copy-Item ./ temp/ linux/* - Destination lib - Exclude (Get-ChildItem lib - Recurse) - Recurse - Include * .exe, * .config - Verbose
116
124
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/
118
127
Copy-Item " ./var/third-party-licenses" - Destination ./ - Recurse
119
128
120
129
$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/
125
134
Get-ChildItem - Directory - Path ./ lib | Where-Object Name -notin ' win-sqlclient' , ' x64' , ' x86' , ' win' , ' mac' , ' macos' | Remove-Item - Recurse
126
135
127
136
Get-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
+
129
142
130
143
if ($isLinux -or $IsMacOs ) {
131
144
chmod + x ./ lib/ sqlpackage
132
145
chmod + x ./ lib/ mac/ sqlpackage
133
146
}
134
147
135
148
Get-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
+ }
137
152
138
- Import-Module ./ dbatools.core.library.psd1
153
+ # Import-Module ./dbatools.core.library.psd1
139
154
140
155
<#
141
156
if ((Get-ChildItem -Path C:\gallery\dbatools.library\core -ErrorAction Ignore)) {
0 commit comments