Summary: Learn how to force Windows PowerShell to comply with basic best practices.
Is there an easy way for me to help Windows PowerShell comply with basic best practices?
Use the Set-StrictMode –Version Latest command to ensure that you cannot reference things such as
uninitialized variables and non-existent properties of an object:
Set-StrictMode -Version latest