Get-Host
Install-Module -Name SqlServerDsc
Get-DscResource -Module SqlServerDsc
New-Item -Path C:\SQL2017 -ItemType Directory
$mountResult = Mount-DiskImage -ImagePath 'C:\vagrant\SQLServer2017-x64-ENU.iso' -PassThru
$volumeInfo = $mountResult | Get-Volume
echo $volumeInfo
$driveInfo = Get-PSDrive -Name $volumeInfo.DriveLetter
echo $driveInfo
Copy-Item -Path ( Join-Path -Path $driveInfo.Root -ChildPath '*' ) -Destination C:\SQL2017\ -Recurse
Dismount-DiskImage -ImagePath 'C:\vagrant\SQLServer2017-x64-ENU.iso'
cd C:\vagrant\scripts\
PS C:\vagrant\scripts\> dir
Directory: C:\Scripts\MSSQLS
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 2/14/2021 5:20 AM 627 SQLInstallConfiguration.ps1
. .\SQLInstallConfiguration.ps1
SQLInstall
Start-DscConfiguration -Path C:\Scripts\MSSQLS\SQLInstall -Wait -Force -Verbose
Test-DscConfiguration
Get-Service -Name *SQL*
Get-Command -ModuleName sqlserver
sqlcmd
SELECT @@SERVERNAME
go
SELECT @@VERSION
go
Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "StefanScherer/windows_2019"
config.vm.network "private_network", ip: "192.168.20.19"
end
SQLServer2017-x64-ENU.iso
- downloaded from :
https://www.microsoft.com/en-us/sql-server/sql-server-downloads
https://www.microsoft.com/en-us/evalcenter/evaluate-sql-server-2019
https://www.google.com/search?q=download+Microsoft+Command+Line+Utilities+for+SQL+Server
Microsoft Command Line Utilities 14.0 for SQL Server
https://www.microsoft.com/en-us/download/details.aspx?id=53591
About sqlcmd Utility
https://docs.microsoft.com/en-us/sql/tools/sqlcmd-utility?view=sql-server-2017
Download the latest version of sqlcmd Utility
https://go.microsoft.com/fwlink/?linkid=2142258
Download ODBC Driver for SQL Server
https://docs.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server?view=sql-server-2017
Install SQL Server with PowerShell Desired State Configuration
https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-with-powershell-desired-state-configuration?view=sql-server-ver15
No comments:
Post a Comment