https://github.com/cviorel/Deploy-Lab
Deploy a SQL Server Availability Group
https://github.com/cviorel/Deploy-Lab
Last synced: 3 months ago
JSON representation
Deploy a SQL Server Availability Group
- Host: GitHub
- URL: https://github.com/cviorel/Deploy-Lab
- Owner: cviorel
- License: mit
- Created: 2021-05-17T10:35:59.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-19T21:12:33.000Z (over 3 years ago)
- Last Synced: 2024-08-14T07:06:40.063Z (6 months ago)
- Language: PowerShell
- Homepage:
- Size: 31.3 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - cviorel/Deploy-Lab - Deploy a SQL Server Availability Group (PowerShell)
README
# Deploy-Lab
```powershell
if (!(Test-Path -Path 'C:\Temp')) {
New-Item -Path 'C:\Temp' -ItemType Directory | Out-Null
}$temp = ([System.IO.Path]::GetTempPath()).TrimEnd("\")
$zipfile = "$temp\main.zip"
$rnd = Get-RandomInvoke-RestMethod -Uri 'https://api.github.com/repos/cviorel/Deploy-Lab/zipball' -OutFile $zipfile
Unblock-File -Path $zipfile -Confirm:$false
Expand-Archive -Path $zipfile -DestinationPath "$temp\$rnd"$unzipped = (Get-ChildItem -Path "$temp\$rnd" -Directory).FullName
Copy-Item -Path $unzipped\* -Recurse -Destination C:\Temp -ForceRemove-Item -Path $zipfile -Force | Out-Null
Remove-Item -Path "$temp\$rnd" -Recurse | Out-NullSet-Location -Path C:\Temp
```