I'm trying to run a command from the OpsMgrExtended module: https://www.powershellgallery.com/packages/OpsMgrExtended/1.3.1 inside a .NET Script activity. Every time I execute this code I'm given the following error. This command works fine in ISE and normal powershell.
The term 'New-OMComputerGroupExplicitMember' 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.
Below is the code I'm running that is redacted a bit
Import-Module -Name OperationsManage, OpsMgrExtended -verbose
New-SCOMManagementGroupConnection -ComputerName "scom.server"
$vms = import-csv C:\Scripts\computers.csv
$scom = 'scom.server'
foreach($vm in $vms)
{
$server = $vm.VmName
New-OMComputerGroupExplicitMember -SDK $scom -GroupName 'group.name' -ComputerPrincipalName $server
}


