Below is the file (highly simplified versions) of interest:
main-func.psm1
:
function main-func
{
[CmdletBinding()]
param
()
Write-Verbose "In main-func"
main-workflow
}
workflow main-workflow
{
[CmdletBinding()]
param
()
Write-Verbose "In main-workflow"
func-outer
}
function func-outer
{
[CmdletBinding()]
param
()
Write-Verbose "In func-outer"
func-inner
}
function func-inner
{
[CmdletBinding()]
param
()
Write-Verbose "In func-inner"
}
Export-ModuleMember -function main-func
Now I open Windows Powershell and execute the following commands:
> Import-Module .\main-func.psm1
> main-func -Verbose
The output that I get is as below:
VERBOSE: In main-func
VERBOSE: [localhost]:In main-workflow
VERBOSE: [localhost]:In func-outer
The term 'func-inner' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a
path was included, verify that the path is correct and try again.
+ CategoryInfo : ObjectNotFound: (func-inner:String) [func-outer], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException,func-outer
+ PSComputerName : [localhost]
But if I replace main-workflow
in function main-func
with func-outer
, then it works.
I'm pretty new to Powershell and Workflows and using workflows is a requirement. Can somebody please explain what's wrong here?