Skip to content

Commit

Permalink
install SqlServer PS module in pwsh
Browse files Browse the repository at this point in the history
  • Loading branch information
freddydk committed Apr 22, 2024
1 parent 4ecb8ae commit c40dafb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions generic/DOCKERFILE
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ RUN Write-Host ('FilesOnly='+$env:filesOnly); \
Write-Host 'Remove x86 dotnet files'; \
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue 'C:\Program Files (x86)\dotnet'

RUN Write-Host 'Installing SqlServer Module in PowerShell 7'; \
pwsh -Command 'Get-Date | Out-Host; Write-Host ''Installing''; Install-Module -Name SqlServer -RequiredVersion 22.2.0 -Scope AllUsers -Force; Write-Host ''SqlServer Module Installed''; Get-Date | Out-Host'; \
Write-Host 'Installed'

HEALTHCHECK --interval=30s --timeout=10s CMD [ "powershell", ".\\Run\\HealthCheck.ps1" ]

EXPOSE 1433 80 8080 443 7045-7049 7083
Expand Down
6 changes: 6 additions & 0 deletions generic/Run/Prompt.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ else {
ImportModule "$serviceTierFolder\Admin\Microsoft.Dynamics.Nav.Management.psm1"
ImportModule "$serviceTierFolder\Admin\Microsoft.BusinessCentral.Management.psd1"
ImportModule "$serviceTierFolder\Admin\Microsoft.BusinessCentral.Apps.Management.dll"
if (Test-Path 'c:\run\my\pscoreoverrides.ps1') {
. 'c:\run\my\pscoreoverrides.ps1'
}
else {
. 'c:\run\pscoreoverrides.ps1'
}
}
else {
if (Test-Path "$serviceTierFolder\Microsoft.Dynamics.Nav.Management.psm1") {
Expand Down
3 changes: 3 additions & 0 deletions generic/Run/pscoreoverrides.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function Invoke-SqlCmd { SqlServer\Invoke-Sqlcmd @args -Encrypt Optional }
function Backup-SqlDatabase { SqlServer\Backup-SqlDatabase @args -Encrypt Optional }
function Restore-SqlDatabase { SqlServer\Restore-SqlDatabase @args -Encrypt Optional }
2 changes: 1 addition & 1 deletion generic/tag.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.2.19
1.0.2.20

0 comments on commit c40dafb

Please sign in to comment.