We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PowerShell provides a native way to check for required modules and a separate function isn't needed as documented here:
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_requires?view=powershell-7.4#-modules-module-name--hashtable The entire test logic for the modules can be replaced by the single line:
#Requires -Modules Az.Resources, Az.Accounts, Az.Websites, Az.Functions, Az.Storage
This line can be placed anywhere in the script, but goes into the begin block by convention.
I will improve the script be bringing it inline with PowerShell standards and making it quicker to error when the modules are not present.
Remove the module test logic and replace with the single line above
the module cannot be loaded without the modules being present
module loads, but fails on initial run.
N/A
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Brief description of your issue
PowerShell provides a native way to check for required modules and a separate function isn't needed as documented here:
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_requires?view=powershell-7.4#-modules-module-name--hashtable
The entire test logic for the modules can be replaced by the single line:
#Requires -Modules Az.Resources, Az.Accounts, Az.Websites, Az.Functions, Az.Storage
This line can be placed anywhere in the script, but goes into the begin block by convention.
I will improve the script be bringing it inline with PowerShell standards and making it quicker to error when the modules are not present.
Steps to reproduce
Remove the module test logic and replace with the single line above
Expected behavior
the module cannot be loaded without the modules being present
Actual behavior
module loads, but fails on initial run.
Environment
The text was updated successfully, but these errors were encountered: