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

Commit

Permalink
Update PowerShell README, test project
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuxel committed Apr 22, 2019
1 parent e6e3162 commit 8075916
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 10 deletions.
16 changes: 16 additions & 0 deletions containers/powershell/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "PowerShell Launch",
"type": "PowerShell",
"request": "launch",
"script": "${workspaceFolder}/test-project/hello.ps1",
"args": [],
"cwd": "${workspaceFolder}/test-project"
}
]
}
34 changes: 29 additions & 5 deletions containers/powershell/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,40 @@
| *Definition type* | Dockerfile |
| *Languages, platforms* | PowerShell |

## Usage
## Using this definition with an existing folder

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

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.
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.

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.
2. To use VS Code's copy of this definition:
1. Start VS Code and open your project folder.
2. Press <kbd>F1</kbd> select and **Remote-Containers: Create Container Configuration File...** from the command palette.
3. Select the PowerShell definition.

3. To use latest-and-greatest copy of this definition from the repository:
1. Clone this repository.
2. Copy the contents of `containers/powershell/.devcontainer` to the root of your project folder.
3. Start VS Code and open your project folder.

4. After following step 2 or 3, the contents of the `.devcontainer` folder in your project can be adapted to meet your needs.

5. Finally, press <kbd>F1</kbd> and run **Remote-Containers: Reopen Folder in Container** to start using the definition.

## Testing the definition

This definition includes some test code that will help you verify it is working as expected on your system. Follow these steps:

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.
2. Clone this repository.
3. Start VS Code, press <kbd>F1</kbd>, and select **Remote-Containers: Open Folder in Container...**
4. Select the `containers/powershell` folder.
5. After the folder has opened in the container, press <kbd>F5</kbd> to start the project.
6. You should see "Hello remote world #1!" up to 100 in a terminal window after the program executes.
7. From here, you can add breakpoints or edit the contents of the `test-project` folder to do further testing.

## License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License. See [LICENSE](../../LICENSE).
Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE).
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function Write-Item($itemCount) {
$i = 1

while ($i -le $itemCount) {
$str = "Output $i"
$str = "Hello remote world #$i!"
Write-Output $str

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


function Do-Work($workCount) {
Write-Output "Doing remote work..."
function Hello($workCount) {
Write-Output "Saying hello..."
Write-Item $workcount
Write-Host "Done!"
Write-Host "Done saying hello!"
}

Do-Work $Count
Hello $Count

0 comments on commit 8075916

Please sign in to comment.