Compatibility

If you are writing scripts on your development system, make sure that you mark them with the lowest PowerShell version that they are compatible with. This will avoid many headaches. Similarly, if your script uses additional modules, add the module name, as well as the module version, to your requires statement.

See Get-Help about_requires for more information and additional requirements, such as RunAsAdministrator.

The following code sample shows a requires statement that contains a required version of PowerShell, as well as a specific version of the storage module:

# Consider using a requires-statement (Get-Help about_requires) to denote what your script needs
#Requires -Version 5.1 -Modules @{ModuleName="Storage";ModuleVersion="2.0.0.0"}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset