├── names.csv ├── directories.json ├── Readme.md ├── BasicQuestions.md └── PreInterviewQuestions.md /names.csv: -------------------------------------------------------------------------------- 1 | First Name,Last Name 2 | PHILIP,fry 3 | turanga,leela 4 | Bender,Rodriguez 5 | aMY,wONG 6 | heRmes,CONrad 7 | Hubert,FarnSWORTH 8 | -------------------------------------------------------------------------------- /directories.json: -------------------------------------------------------------------------------- 1 | { 2 | "Grandparent": { 3 | "Parent": "Child" 4 | }, 5 | "Very": { 6 | "Many": { 7 | "Subdirectories": { 8 | "Make": { 9 | "Me": { 10 | "Very": "Happy" 11 | 12 | } 13 | } 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # PowerShell Practical Interview 2 | This repository contains two practical PowerShell tests. One a [pre-interview test](PreInterviewQuestions.md), the other an [in person test](BasicQuestions.md) with basic questions. 3 | 4 | # Pre-interview Test 5 | The pre-interview test has no time limit, and should be completed to the highest standard possible as this will factor into the selection process. 6 | [Pre-interview test](PreInterviewQuestions.md) 7 | 8 | # Basic PowerShell 9 | The basic PowerShell test will be administered in person during the face-to-face interview process, and will be timeboxed to 45 minutes. 10 | [Basic PowerShell ](BasicQuestions.md) 11 | -------------------------------------------------------------------------------- /BasicQuestions.md: -------------------------------------------------------------------------------- 1 | # Basic PowerShell Practical Interview 2 | 3 | ## Pre-requisites 4 | 1. Clone this repository to your local computer 5 | 6 | ## Scenario 1 7 | You have a csv file containing a list of users' names incorrectly captilised. 8 | You need to output a JSON file containing the users' names properly capitalised, with at least one user assigned the property "Administrator" at random. 9 | 10 | ### Acceptance Criteria 11 | 12 | 1. Valid JSON file 13 | 2. Correctly capitalised names 14 | 3. One user assigned the property administrator 15 | 16 | ## Scenario 2 17 | You need to retrieve a list of all *running* services on a computer, including the user the service runs as. 18 | This needs to be output to a CSV file, with headers, but without any extraneous metadata. 19 | 20 | ### Acceptance Criteria 21 | 22 | 1. Valid CSV file 23 | 2. CSV file has headers 24 | 3. CSV file does not contain extraneous metada 25 | 26 | 27 | ## Completion Scenario 28 | Commit each script to a new branch of this repository with an appropriate commit message and branch name based on gitflow. 29 | 30 | ### Acceptance Criteria 31 | 32 | 1. One branch per script 33 | 2. Appropriate commit message 34 | 3. Appropriate branch name 35 | 36 | 37 | ## Bonus Scenario 38 | Create Pester tests for the first script and commit to its branch, and submit a pull request to [https://github.com/Sam-Martin/PowerShell-Interview-Practical](https://github.com/Sam-Martin/PowerShell-Interview-Practical) 39 | 40 | ### Acceptance Criteria 41 | 42 | 1. Pester tests covering randomised input to script #1 43 | 2. Committed to the scripts' branch with an appropriate commit message 44 | 3. Pull request submitted to [https://github.com/Sam-Martin/PowerShell-Interview-Practical](https://github.com/Sam-Martin/PowerShell-Interview-Practical) 45 | -------------------------------------------------------------------------------- /PreInterviewQuestions.md: -------------------------------------------------------------------------------- 1 | # Pre-Interview Questions 2 | The pre-interview test has no time limit, and should be completed to the highest standard possible as this will factor into the selection process. 3 | 4 | ## Pre-requisites 5 | 1. Fork this repository to your own GitHub account 6 | 2. Clone your fork of this repository to your local computer 7 | 8 | ## Scenario 1 9 | You need to create a nested set of folders based on the `directories.json` file. 10 | In each subdirectory you must create a text file named `random.txt` which contains a random number from 8-100. 11 | You must be able to re-run the script multiple times without errors, with each run updating the random number in the previously created files. 12 | 13 | ### Success Criteria 14 | 1. Folders created in accordance with `directories.json` 15 | 2. At least one `random.txt` file created 16 | 3. All created `random.txt` files contain a random number between 8-100 17 | 4. Running the script multiple times updates the random numbers in the `random.txt` files 18 | 5. Running the script multiple times does not create new `random.txt` files 19 | 6. The script must be tested with [Pester](https://github.com/pester/Pester) 20 | 7. The script must pass by [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) 21 | 22 | ## Scenario 2 23 | You need to retrieve a count of the number of times the word `PowerShell` appears in the [PowerShell Wikipedia Page](https://en.wikipedia.org/wiki/PowerShell). 24 | The script must also retrieve a list of links from the same page which point to the domain `microsoft.com`. 25 | The script must generate an HTML file which contains clickable links of each URL identified for `microsoft.com`. 26 | 27 | ### Success criteria 28 | 1. Script must output a number to console reflecting the number of times the word `PowerShell` is mentioned on the page 29 | 2. Script must output an HTML file which contains clickable links of each URL identified for `microsoft.com` on the page 30 | 3. The script must be tested with [Pester](https://github.com/pester/Pester) 31 | 4. The script must pass by [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) 32 | 33 | ## Completion 34 | 1. Submit a Pull Request to this repository and inform the recruiter that you have completed the Pre-Interview questions 35 | 36 | ## Bonus Round 37 | Using [appveyor.com](http://appveyor.com), automate the execution of your Pester tests and PSScriptAnalyzer. --------------------------------------------------------------------------------