Situation
You’re a monster like me and have standardised on newline braces in PowerShell, but the vscode PowerShell extension has used inline braces.
Solution
- Copy the snippets you use from
%userprofile%\.vscode\extensions\ms-vscode.powershell-1.5.1\snippets\PowerShell.json - Add them to your user snippets for PowerShell (CTRL+SHIFT+P > Open User Snippets > PowerShell)
- CTRL+F, regex mode
- Find
\{", - Replace with
",\n\t\t\t"{",

- CTRL+, to open user settings, then add
"editor.snippetSuggestions": "top" - Note: there are PowerShell user settings for code formatting, but I found these didn’t apply to snippets. Probably good to bang
"powershell.codeFormatting.preset": "Allman"into there anyway - Save all and you’re good to go!
Videogames
Hey, do you like videogames? If so, please check out my game Inventor Simulator on Steam, and consider adding it to your wishlist. Craft inventions and sell them to customers, then automate your workbench, workshop and store! Research new inventions or create your own from scratch. Set prices based on an economic model, unlock and craft upgrades, and vertically integrate your supply chain. Become the world's greatest inventor!See full gameplay on Steam!