I created an Azure Function. In this function I would like to implement some helper functions. I dont want to import modules, but would like to add the helper functions inside the function. How can I implement this?
For example
using namespace System.Net
function HelperFunctionCreateTab {param([string] $tabName, [string] $channelName)
// some helper function logic
}
param($Request, $TriggerMetadata)
Write-Output "START"
// some main function logic
HelperFunctionCreateTab -tabName "tabX" -channelName "channelY"
// some main function logic
Write-Output "START"
If you intent to implement the helper function in the same azure function then you need to add it after
paramblock.paramblock needs to be at the top, afterusingblock in your function or else you will get input binding error.I am using below code to implement the helper function.
Output-