mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-21 09:28:21 +02:00
Update FAQ.md
This commit is contained in:
parent
23ce80ee6a
commit
ce6b209384
27
Docs/FAQ.md
27
Docs/FAQ.md
@ -106,18 +106,17 @@ Want to use the PowerShell scripts everywhere on the command-line? Then you need
|
|||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details><summary>How to write good PowerShell scripts?</summary>
|
<details><summary>How to write good PowerShell scripts?</summary>
|
||||||
|
Good PowerShell scripts are both user-friendly and platform-independent. As a starting point I recommend the following:
|
||||||
|
|
||||||
Good PowerShell scripts are both user-friendly and platform-independent. I recommend the following rules as a starting point:
|
* Use the `<verb>-<object>.ps1` scheme to name the script.
|
||||||
|
* Use `UTF-8 BOM` encoding to support Unicode characters in the script.
|
||||||
1. Use the `<verb>-<object>.ps1` scheme to name the script.
|
* Add a comment-based help at the beginning with: `.SYNOPSIS`, `.DESCRIPTION`, `.PARAMETER`, `.EXAMPLE`, `.LINK`, and `.NOTES`.
|
||||||
2. Use `UTF-8 BOM` encoding to support Unicode characters in the script.
|
* Check the requirements for the script, e.g. `#Requires -RunAsAdministrator`, or `#Requires -Version 3`
|
||||||
3. Add a comment-based help at the beginning with: `.SYNOPSIS`, `.DESCRIPTION`, `.PARAMETER`, `.EXAMPLE`, `.LINK`, and `.NOTES`.
|
* Prefer command-line options, else ask the user for help
|
||||||
4. Check the requirements for the script, e.g. `#Requires -RunAsAdministrator`, or `#Requires -Version 3`
|
* Recommended is `Set-StrictMode -Version Latest` to enable additional error checking.
|
||||||
5. Prefer command-line options, else ask the user for help
|
* For readibility use UpperCamelCase for variables and functions, lowerCamelCase for everything else.
|
||||||
6. Recommended is `Set-StrictMode -Version Latest` to enable additional error checking.
|
* Set *execute* file permissions for Linux: `chmod a+rx <filename>`
|
||||||
7. For readibility use UpperCamelCase for variables and functions, lowerCamelCase for everything else.
|
* 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)
|
||||||
8. Set *execute* file permissions for Linux: `chmod a+rx <filename>`
|
|
||||||
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)
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details><summary>Where's the Star History of this repo?</summary>
|
<details><summary>Where's the Star History of this repo?</summary>
|
||||||
@ -125,13 +124,13 @@ Good PowerShell scripts are both user-friendly and platform-independent. I recom
|
|||||||
[](https://star-history.com/#fleschutz/PowerShell&Date)
|
[](https://star-history.com/#fleschutz/PowerShell&Date)
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details><summary>Want to contribute or found a bug or issue?</summary>
|
<details><summary>How to contribute or how to report a bug?</summary>
|
||||||
|
|
||||||
If you find something bad (like a bug, error, or any issue), please report it here by opening an Issue.
|
If you find something bad (like a bug, error, or any issue), please report it here by opening an Issue.
|
||||||
|
|
||||||
Or even better: Fork the repository, add or fix the script and submit a pull request, so others can participate too.
|
Or even better: Fork the repository, add or fix the script and submit a pull request, so others can participate too.
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details><summary>Your question is not answered here?</summary>
|
<details><summary>What if my question is not answered here?</summary>
|
||||||
Send your question to: markus.fleschutz [at] gmail.com
|
Just send your question to: markus.fleschutz [at] gmail.com
|
||||||
</details>
|
</details>
|
||||||
|
Loading…
Reference in New Issue
Block a user