# IT:AD:Code:HowTo:PowerShell:Setup For Development #
* [[../|(UP)]]
{{indexmenu>.#2|nsort tsort}}
Open the folder containing your scripts.
## Process ##
* Start [[IT/AD/Code/]] in a new directory.
* `Ctrl+Shift+P`, then `user`to edit the user `settings.json` file for that folder.
* On the right, provide the following:
// Place your settings in this file to overwrite the default settings
{
"editor.lineNumbers": true,
"terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\WindowsPowerShell\\v1.0\\powershell.exe",
"powershell.developer.powerShellExePath": "C:\\Windows\\sysnative\\WindowsPowershell\\v1.0\\powershell.exe"
}
* Create a `test.ps1` file. Add a method
function Get-Hello(){
Write-Host "Hi!"
}
### Using the Execution Environment
To run it, you have to open a `Execution Environment`:
# Existing:
Ctrl-`
# or new one:
Ctrl-Shift-`
Load the file:
./YourFile.ps1
Then run it.
Gay-Hello
### Using Pester
But loading up files on the command line is a PIA.
Use [[IT/AD/Pester/HowTo/Create Tests/]]
### Debugging
Pretty straightforward((https://rkeithhill.wordpress.com/2015/12/27/debugging-powershell-script-with-visual-studio-code/)).