Good morning,
The following works when I run it as is or in a fucntion:
if (-not (Get-Module VMware.VimAutomation.Core -ErrorAction SilentlyContinue)) {
Import-Module -Name VMware.VimAutomation.Core
}
things like Get-VM works
When I put it into a function in a custom module It appears to work but I can’t run any of the cmdlets like Get-VM. It appears to be a scope issue. I’ve tried the -global parameter with Import-Module with no luck.
How can I import a module from within another module and make the cmdlets avaiable in PowerShell? Thanks for the help.