Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
Added a dev container for PS
Browse files Browse the repository at this point in the history
  • Loading branch information
egamma committed Jan 16, 2019
1 parent ddc63f0 commit e9b9c1e
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dev-containers/powershell-container/.vscode/devContainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"dockerFile": "dev-container.dockerfile",
"extensions": [
"ms-vscode.powershell"
]
}
6 changes: 6 additions & 0 deletions dev-containers/powershell-container/dev-container.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM microsoft/powershell

# Install required tools
RUN apt-get update \
&& apt-get install -y git \
&& rm -rf /var/lib/apt/lists/*
28 changes: 28 additions & 0 deletions dev-containers/powershell-container/test.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
param([int]$Count=50, [int]$DelayMilliseconds=200)

function Write-Item($itemCount) {
$i = 1

while ($i -le $itemCount) {
$str = "Output $i"
Write-Output $str

# In the gutter on the left, right click and select "Add Conditional Breakpoint"
# on the next line. Use the condition: $i -eq 25
$i = $i + 1

# Slow down execution a bit so user can test the "Pause debugger" feature.
Start-Sleep -Milliseconds $DelayMilliseconds
}
}

# Do-Work will be underlined in green if you haven't disable script analysis.
# Hover over the function name below to see the PSScriptAnalyzer warning that "Do-Work"
# doesn't use an approved verb.
function Do-Work($workCount) {
Write-Output "Doing work..."
Write-Item $workcount
Write-Host "Done!"
}

Do-Work $Count

0 comments on commit e9b9c1e

Please sign in to comment.