mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-11 16:39:10 +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 #4:** provide a metadata header with syntax, description, author, source, and license
|
||||||
* **Rule #5:** prefer command-line options, else ask the user
|
* **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 #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
|
Feedback
|
||||||
--------
|
--------
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
# License: CC0
|
# License: CC0
|
||||||
|
|
||||||
|
Set-StrictMode -Version Latest
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$StartTime = Get-Date
|
$StartTime = Get-Date
|
||||||
|
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
param([String]$Text)
|
param([String]$Text)
|
||||||
|
|
||||||
|
Set-StrictMode -Version Latest
|
||||||
|
|
||||||
function BigA() { param([Int]$Row)
|
function BigA() { param([Int]$Row)
|
||||||
switch($Row) {
|
switch($Row) {
|
||||||
1 { return " __ " }
|
1 { return " __ " }
|
||||||
|
Loading…
Reference in New Issue
Block a user