diff --git a/powershell/hello-world/.exercism/config.json b/powershell/hello-world/.exercism/config.json new file mode 100644 index 0000000..259fb96 --- /dev/null +++ b/powershell/hello-world/.exercism/config.json @@ -0,0 +1,26 @@ +{ + "blurb": "The classical introductory exercise. Just say \"Hello, World!\"", + "authors": [ + "spuder" + ], + "contributors": [ + "gyssels", + "kchenery", + "kytrinyx", + "marcus-crane", + "masters3d" + ], + "files": { + "solution": [ + "HelloWorld.ps1" + ], + "test": [ + "HelloWorld.tests.ps1" + ], + "example": [ + ".meta/HelloWorld.example.ps1" + ] + }, + "source": "This is an exercise to introduce users to using Exercism", + "source_url": "http://en.wikipedia.org/wiki/%22Hello,_world!%22_program" +} diff --git a/powershell/hello-world/.exercism/metadata.json b/powershell/hello-world/.exercism/metadata.json new file mode 100644 index 0000000..4d137f0 --- /dev/null +++ b/powershell/hello-world/.exercism/metadata.json @@ -0,0 +1 @@ +{"track":"powershell","exercise":"hello-world","id":"e2b780a4b32c4a1abe367cb0e62e4c0f","url":"https://exercism.org/tracks/powershell/exercises/hello-world","handle":"Xevion","is_requester":true,"auto_approve":false} \ No newline at end of file diff --git a/powershell/hello-world/.version b/powershell/hello-world/.version new file mode 100644 index 0000000..56a6051 --- /dev/null +++ b/powershell/hello-world/.version @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/powershell/hello-world/GETTING_STARTED.md b/powershell/hello-world/GETTING_STARTED.md new file mode 100644 index 0000000..0d9fd85 --- /dev/null +++ b/powershell/hello-world/GETTING_STARTED.md @@ -0,0 +1,33 @@ +# Getting Started + +These exercises lean on Test-Driven Development (TDD), + +For information installing Powershell click [here](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.1). + +Once Powershell is installed you will need to install the Pester module by running the following command in Powershell: + + PS> Install-Module Pester + +The following steps assume that you are in the same directory as the test suite. + +Run the test suite. It's written using the Pester framework, and can be +run with powershell: + + PS> Invoke-Pester + +This will fail. To fix it, open up the HelloWorld.ps1 file and add the following code: + + ``` + function Get-HelloWorld { + return "Hello World!" + } + ``` + +Run the test again. + +## Submit + +When everything is passing, you can submit your code with the following +command: + + PS> exercism submit HelloWorld.ps1 diff --git a/powershell/hello-world/HELP.md b/powershell/hello-world/HELP.md new file mode 100644 index 0000000..36edf75 --- /dev/null +++ b/powershell/hello-world/HELP.md @@ -0,0 +1,33 @@ +# Help + +## Running the tests + +To run the tests run the command `Invoke-Pester` from within the exercise directory. + +## Submitting your solution + +You can submit your solution using the `exercism submit HelloWorld.ps1` command. +This command will upload your solution to the Exercism website and print the solution page's URL. + +It's possible to submit an incomplete solution which allows you to: + +- See how others have completed the exercise +- Request help from a mentor + +## Need to get help? + +If you'd like help solving the exercise, check the following pages: + +- The [PowerShell track's documentation](https://exercism.org/docs/tracks/powershell) +- [Exercism's support channel on gitter](https://gitter.im/exercism/support) +- The [Frequently Asked Questions](https://exercism.org/docs/using/faqs) + +Should those resources not suffice, you could submit your (incomplete) solution to request mentoring. + +To get help if you are having trouble, you can use one of the following resources: + +- [Powershell Documentation][powershell docs] + +[Add more resources]: TODO + +[powershell docs]: https://docs.microsoft.com/en-us/powershell/ \ No newline at end of file diff --git a/powershell/hello-world/HelloWorld.ps1 b/powershell/hello-world/HelloWorld.ps1 new file mode 100644 index 0000000..ffc5c8e --- /dev/null +++ b/powershell/hello-world/HelloWorld.ps1 @@ -0,0 +1,14 @@ +function Get-HelloWorld { + <# + .SYNOPSIS + Outputs "Hello, World!" + + .DESCRIPTION + Output "Hello, World!". + + .EXAMPLE + Get-HelloWorld + #> + + return "Hello, World!" +} diff --git a/powershell/hello-world/HelloWorld.tests.ps1 b/powershell/hello-world/HelloWorld.tests.ps1 new file mode 100644 index 0000000..c5f88be --- /dev/null +++ b/powershell/hello-world/HelloWorld.tests.ps1 @@ -0,0 +1,9 @@ +BeforeAll { + . ".\HelloWorld.ps1" +} + +Describe "HelloWorldTest" { + It "Outputs: 'Hello, World!'" { + Get-HelloWorld | Should -Be 'Hello, World!' + } +} diff --git a/powershell/hello-world/README.md b/powershell/hello-world/README.md new file mode 100644 index 0000000..20b24f8 --- /dev/null +++ b/powershell/hello-world/README.md @@ -0,0 +1,38 @@ +# Hello World + +Welcome to Hello World on Exercism's PowerShell Track. +If you need help running the tests or submitting your code, check out `HELP.md`. + +## Instructions + +The classical introductory exercise. Just say "Hello, World!". + +["Hello, World!"](http://en.wikipedia.org/wiki/%22Hello,_world!%22_program) is +the traditional first program for beginning programming in a new language +or environment. + +The objectives are simple: + +- Write a function that returns the string "Hello, World!". +- Run the test suite and make sure that it succeeds. +- Submit your solution and check it at the website. + +If everything goes well, you will be ready to fetch your first real exercise. + +## Source + +### Created by + +- @spuder + +### Contributed to by + +- @gyssels +- @kchenery +- @kytrinyx +- @marcus-crane +- @masters3d + +### Based on + +This is an exercise to introduce users to using Exercism - http://en.wikipedia.org/wiki/%22Hello,_world!%22_program \ No newline at end of file