The module was failing to load for me on Windows Server 2016. Line 68 of PSDuo.psd1 has an array FunctionsToExport causing the problem. The fix was to put each function name in quotes, eg:
FunctionsToExport = @('Get-DuoConfig', 'Get-DuoGroup', 'Get-DuoPhone', 'Get-DuoUser', 'Invoke-DuoAuth', 'Invoke-DuoPreAuth', 'New-DuoConfig', 'New-DuoUser', 'Remove-DuoPhone', 'Remove-DuoUser', 'Set-DuoGroup', 'Set-DuoUser', 'Test-DuoConnection')
PS C:> Import-Module PSDuo
Import-Module : The module manifest 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSDuo\PSDuo.psd1' could not be processed because it is not a valid Windows PowerShell restricted language file. Remove the elements that are not
permitted by the restricted language:
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSDuo\PSDuo.psd1:68 char:36
- FunctionsToExport = @(Get-DuoConfig, Get-DuoGroup, Get-DuoPhone, Get- ...
-
Missing argument in parameter list.
At line:1 char:1
- Import-Module PSDuo
-
+ CategoryInfo : ResourceUnavailable: (C:\Windows\syst...SDuo\PSDuo.psd1:String) [Import-Module], Missing
MemberException
+ FullyQualifiedErrorId : Modules_InvalidManifest,Microsoft.PowerShell.Commands.ImportModuleCommand
The module was failing to load for me on Windows Server 2016. Line 68 of PSDuo.psd1 has an array FunctionsToExport causing the problem. The fix was to put each function name in quotes, eg:
FunctionsToExport = @('Get-DuoConfig', 'Get-DuoGroup', 'Get-DuoPhone', 'Get-DuoUser', 'Invoke-DuoAuth', 'Invoke-DuoPreAuth', 'New-DuoConfig', 'New-DuoUser', 'Remove-DuoPhone', 'Remove-DuoUser', 'Set-DuoGroup', 'Set-DuoUser', 'Test-DuoConnection')
PS C:> Import-Module PSDuo
Import-Module : The module manifest 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSDuo\PSDuo.psd1' could not be processed because it is not a valid Windows PowerShell restricted language file. Remove the elements that are not
permitted by the restricted language:
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSDuo\PSDuo.psd1:68 char:36
Missing argument in parameter list.
At line:1 char:1