From c4a50bc586798be61849a70157c715783f4aae96 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Wed, 10 May 2023 14:12:49 +0200 Subject: [PATCH] Update FAQ.md --- Docs/FAQ.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Docs/FAQ.md b/Docs/FAQ.md index b33bacb0..4db1cc9d 100644 --- a/Docs/FAQ.md +++ b/Docs/FAQ.md @@ -71,22 +71,23 @@ Make sure PowerShell is installed, then execute: `chsh -s /usr/bin/pwsh -How to add the scripts to the search path? ------------------------------------------- +
How to add the scripts to the search path? + Want to use the PowerShell scripts everywhere on the command-line? Then you need to add the Scripts/ subfolder to the search path: * **On Linux using Bash:** edit .profile in your home directory and add the line: PATH="$PATH:/path/to/PowerShell/Scripts" * **On Windows:** open Settings > System > About > Advanced system settings > Environment Variables, edit the user's variable "Path", and add the full path to the Scripts/ directory. +
- -How to use PowerShell in Windows context menus? ------------------------------------------------ +
How to use PowerShell in Windows context menus? + * to enable "right-click > New > Windows PowerShell Script" execute `Add_ps1_to_New_context_menu.reg` in subfolder [Data/](../Data) * to disable this execute `Remove_ps1_from_New_context_menu.reg` in subfolder [Data/](../Data) +
-Which editor to use for PowerShell scripts? -------------------------------------------- +
Which editor to use for PowerShell scripts? + * **Visual Studio Code** - Supporting syntax highlighting, on-the-fly problem checking and an integrated PowerShell Console (available for free on Linux, Mac OS and Windows, now recommended by Microsoft). * **PowerShell ISE** (Integrated Scripting Environment) - Former official PowerShell development environment included with Microsoft Windows. * **PowerShell Studio** - Powerful PowerShell IDE with module, help, and user interface development tools, high DPI support and regular updates. @@ -94,10 +95,10 @@ Which editor to use for PowerShell scripts? * **Atom package** - Add-on with PowerShell language support for Atom. * **SublimeText package** - Add-on with PowerShell language support for Sublime Text. * or your **favorite text editor** as an alternative. +
+
How to write good PowerShell scripts? -How to write good PowerShell scripts? -------------------------------------- Good PowerShell scripts are both user-friendly and platform-independent. I recommend the following rules as a starting point: 1. Use the `-.ps1` scheme to name the script. @@ -109,20 +110,19 @@ Good PowerShell scripts are both user-friendly and platform-independent. I recom 7. For readibility use UpperCamelCase for variables and functions, lowerCamelCase for everything else. 8. Set *execute* file permissions for Linux: `chmod a+rx ` 9. On success exit with error code 0 (`exit 0`), otherwise print the error with keyword "ERROR:" (to support log parsers) and exit the error code (mostly 1) + - -Where's the Star History? -------------------------- +
Where's the Star History?> [![Star History Chart](https://api.star-history.com/svg?repos=fleschutz/PowerShell&type=Date)](https://star-history.com/#fleschutz/PowerShell&Date) +
+
Want to contribute or found a bug or issue? -Want to contribute or found a bug or issue? -------------------------------------------- If you find something bad (like a bug, error, or any issue), please report it here by open an Issue. Or even better: Fork the repository, add or fix the script and submit a pull request, so others can participate too. +
- -Your question is not answered here? ------------------------------------ +
Your question is not answered here? Send your question to: markus.fleschutz [at] gmail.com +