header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left

[BANNER]

[BANNER]

This area of the Web site is freely editable by all registered users. When editing, expand the "Directions" item for instructions on creating and linking to new pages. Please help keep this area of the community neat and clean by adding appropriate edits and so forth.

This area of the Web site is freely editable by all registered users. When editing, expand the "Directions" item for instructions on creating and linking to new pages. Please help keep this area of the community neat and clean by adding appropriate edits and so forth.

Reliability


Name: AvoidAffectingGlobalOrParentScopes
Short Description: When run, commands should not affect the global or parent scopes.
Long Description:
Scripts that affect the global or parent scopes may interfere with the user's environment. Use the script's output stream to return data to the user.
Source / References:
PowerShell Team Guidance
Status: Accepted
Discussion / Open Issues:
None

 

 
 
Name: PrefixGlobalVariablesWithAUniqueNamespace
Short Description: If your script requires a global variable (such as a data store or cache,) prefix its name with a unique namespace identifier.
Long Description:
Scripts that affect the global or parent scopes may interfere with the user's environment. To minimize the chances of collision, prefix global variables with a unique namespace identifier -- such as your name, company name, or product name. Naming a variable this way requires the more permissive variable syntax:
 
${GLOBAL:Microsoft.PowerShell.SqlCommands.DatabaseCache} =
Source / References:
PowerShell Team Guidance
Status: Accepted
Discussion / Open Issues:
None

 

 
 
Name: ScriptsMustRunInStrictMode
Short Description: Scripts must run without error when PowerShell is in strict mode.
Long Description:
Strict mode helps prevent common scripting mistakes, such as accessing a variable that you have not yet defined. Many users run with strict mode always enabled, so a script that fails under strict mode:
- Likely has bugs
- Causes users to disable strict mode just to run your script
Source / References:
PowerShell Team Guidance
Status: Accepted
Discussion / Open Issues:
None

 

 
Name: AvoidAliasesInScripts
Short Description: In scripts or functions that you share, prefer fully-expanded cmdlet names over aliases.
Long Description:
Aliases are primarily designed to make you more efficent while working in the interactive shell or creating one-off scripts. Since not everybody knows all of the default PowerShell aliases, sharing a script that uses them can make your script much harder to understand. Readability issues aside, it is otherwise safe to use them.
Source / References:
PowerShell Team Guidance
Status: Accepted
Discussion / Open Issues:
None

 




 |  View Topic History  |
right
footer   footer
footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
footer   footer