mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-08 09:04:18 +01:00
Added 'Set-ScrictMode'
This commit is contained in:
parent
a7bbbb99a7
commit
d088342086
@ -135,7 +135,8 @@ Each PowerShell script should follow the 7 golden rules:
|
||||
* **Rule #4:** provide a metadata header with syntax, description, author, source, and license
|
||||
* **Rule #5:** prefer command-line options, else ask the user
|
||||
* **Rule #6:** the encoding of the script is in UTF-8 with BOM to support Unicode characters
|
||||
* **Rule #7:** exits 0 for success, else print an error message and exit with the error code (mostly 1)
|
||||
* **Rule #7:** use 'Set-StrictMode -Version Latest' to enable additional error checking
|
||||
* **Rule #8:** exits 0 for success, else print an error message and exit with the error code (mostly 1)
|
||||
|
||||
Feedback
|
||||
--------
|
||||
|
@ -5,6 +5,8 @@
|
||||
# Author: Markus Fleschutz
|
||||
# Source: github.com/fleschutz/PowerShell
|
||||
# License: CC0
|
||||
|
||||
Set-StrictMode -Version Latest
|
||||
|
||||
try {
|
||||
$StartTime = Get-Date
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
param([String]$Text)
|
||||
|
||||
Set-StrictMode -Version Latest
|
||||
|
||||
function BigA() { param([Int]$Row)
|
||||
switch($Row) {
|
||||
1 { return " __ " }
|
||||
|
Loading…
Reference in New Issue
Block a user