Windows Server® 2012 Unleashed
by Rand Morimoto, Michael Noel, Guy Yardeni, Omar Droubi, Andrew Abbate, Chris Amaris
Best Practices
The following are best practices from this chapter:
• If a function needs to persist across PowerShell sessions, define that function within your profile.ps1 file.
• To access block information about a base, use the BaseObject property with the PSBase standard name.
• When naming a variable, don’t use special characters or spaces.
• When using aliases and variables in a script, use names that other people can understand.
• If possible, try not to use aliases in a script.
• In a production environment, don’t configure the PowerShell execution policy as unrestricted and always digitally sign your scripts.
• If built-in PowerShell cmdlets don’t meet your needs, always remember that you can fall back onto existing automation interfaces ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access