Skip to content

Commit e0c77e4

Browse files
committed
Passing on a clean machine
1 parent 67b247b commit e0c77e4

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

AgentMode/.github/copilot-instructions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,11 @@ NOTES:
8181

8282
**Action:**
8383
- Ensure a container runtime (e.g. docker or podman) is running by running `./.github/tsql/install/is-container-runtime-running.ps1`
84+
- If a container runtime is not running, ensure the user does not proceed until a container runtime is installed and running.
8485
- Ensure `sqlcmd` is installed by running `./.github/tsql/install/ensure-sqlcmd-installed.ps1`
8586
- Ensure `Build.Sql.Templates` is installed by running `./.github/tsql/install/ensure-build-sql-templates-installed.ps1`
8687
- Ensure `SqlPackage` is installed by running `./.github/tsql/install/ensure-sqlpackage-installed.ps1`
88+
- NOTE: If the following message is returned after installing `SqlPackage`: `Since you just installed the .NET SDK, you will need to reopen the Command Prompt window before running the tool you installed.`, run `exit` in the terminal window, so another terminal window will be created for the next command.
8789

8890
### Step 2: Create a Local SQL Server Instance
8991

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,46 @@
11
# A powershell script for Windows to check if any desktop container runtime is available and running
22

3+
function Write-ContainerRuntimeInstructions {
4+
Write-Host "To install a container runtime, please visit the following links:"
5+
Write-Host "- Docker Desktop: https://www.docker.com/products/docker-desktop"
6+
Write-Host "- Podman Desktop: https://podman-desktop.io/"
7+
Write-Host "Please install one of these runtimes and try again."
8+
}
9+
310
# Check if Docker Desktop is running
11+
$dockerAvailable = $false
12+
$dockerRunning = $false
413
if (Get-Command "docker" -ErrorAction SilentlyContinue) {
5-
$dockerStatus = & docker info --format '{{.ServerVersion}}'
14+
$dockerAvailable = $true
15+
$dockerStatus = & docker info --format '{{.ServerVersion}}' 2>$null
616
if ($dockerStatus) {
717
Write-Host "Docker Desktop is running."
818
exit 0
919
} else {
1020
Write-Host "Docker Desktop is not running."
11-
exit 1
1221
}
1322
}
1423

1524
# Check if Podman Desktop is running
25+
$podmanAvailable = $false
26+
$podmanRunning = $false
1627
if (Get-Command "podman" -ErrorAction SilentlyContinue) {
17-
$podmanStatus = & podman info --format '{{.ServerVersion}}'
28+
$podmanAvailable = $true
29+
$podmanStatus = & podman info --format '{{.ServerVersion}}' 2>$null
1830
if ($podmanStatus) {
1931
Write-Host "Podman Desktop is running."
2032
exit 0
2133
} else {
2234
Write-Host "Podman Desktop is not running."
23-
exit 1
2435
}
2536
}
37+
38+
if (-not $dockerAvailable -and -not $podmanAvailable) {
39+
Write-Error "The `docker` and `podman` commands are not available"
40+
Write-ContainerRuntimeInstructions
41+
exit 1
42+
}
43+
44+
Write-Error "No container runtime is running."
45+
Write-ContainerRuntimeInstructions
46+
exit 1

0 commit comments

Comments
 (0)