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

Commit 8075916

Browse files
committed
Update PowerShell README, test project
1 parent e6e3162 commit 8075916

File tree

3 files changed

+50
-10
lines changed

3 files changed

+50
-10
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "PowerShell Launch",
9+
"type": "PowerShell",
10+
"request": "launch",
11+
"script": "${workspaceFolder}/test-project/hello.ps1",
12+
"args": [],
13+
"cwd": "${workspaceFolder}/test-project"
14+
}
15+
]
16+
}

containers/powershell/README.md

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,40 @@
1010
| *Definition type* | Dockerfile |
1111
| *Languages, platforms* | PowerShell |
1212

13-
## Usage
13+
## Using this definition with an existing folder
1414

15-
[See here for information on using this definition with an existing project](../../README.md#using-a-definition).
15+
This definition does require any special steps to use. Just follow these steps:
1616

17-
If you prefer, you can also just look through the contents of the `.devcontainer` folder to understand how to make changes to your own project.
17+
1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.
1818

19-
If you want to try out the test project instead, run **Remote-Container: Open Folder in Container...** in VS Code and select a cloned copy of the entire folder. Run the script in `test-project` to check it out.
19+
2. To use VS Code's copy of this definition:
20+
1. Start VS Code and open your project folder.
21+
2. Press <kbd>F1</kbd> select and **Remote-Containers: Create Container Configuration File...** from the command palette.
22+
3. Select the PowerShell definition.
23+
24+
3. To use latest-and-greatest copy of this definition from the repository:
25+
1. Clone this repository.
26+
2. Copy the contents of `containers/powershell/.devcontainer` to the root of your project folder.
27+
3. Start VS Code and open your project folder.
28+
29+
4. After following step 2 or 3, the contents of the `.devcontainer` folder in your project can be adapted to meet your needs.
30+
31+
5. Finally, press <kbd>F1</kbd> and run **Remote-Containers: Reopen Folder in Container** to start using the definition.
32+
33+
## Testing the definition
34+
35+
This definition includes some test code that will help you verify it is working as expected on your system. Follow these steps:
36+
37+
1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.
38+
2. Clone this repository.
39+
3. Start VS Code, press <kbd>F1</kbd>, and select **Remote-Containers: Open Folder in Container...**
40+
4. Select the `containers/powershell` folder.
41+
5. After the folder has opened in the container, press <kbd>F5</kbd> to start the project.
42+
6. You should see "Hello remote world #1!" up to 100 in a terminal window after the program executes.
43+
7. From here, you can add breakpoints or edit the contents of the `test-project` folder to do further testing.
2044

2145
## License
2246

2347
Copyright (c) Microsoft Corporation. All rights reserved.
2448

25-
Licensed under the MIT License. See [LICENSE](../../LICENSE).
49+
Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE).

containers/powershell/test-project/test.ps1 renamed to containers/powershell/test-project/hello.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function Write-Item($itemCount) {
1010
$i = 1
1111

1212
while ($i -le $itemCount) {
13-
$str = "Output $i"
13+
$str = "Hello remote world #$i!"
1414
Write-Output $str
1515

1616
# In the gutter on the left, right click and select "Add Conditional Breakpoint"
@@ -23,10 +23,10 @@ function Write-Item($itemCount) {
2323
}
2424

2525

26-
function Do-Work($workCount) {
27-
Write-Output "Doing remote work..."
26+
function Hello($workCount) {
27+
Write-Output "Saying hello..."
2828
Write-Item $workcount
29-
Write-Host "Done!"
29+
Write-Host "Done saying hello!"
3030
}
3131

32-
Do-Work $Count
32+
Hello $Count

0 commit comments

Comments
 (0)