Error publishing bynary module. Restricted language mode.

Francisco Nabas 31 Reputation points
2022-09-05T23:31:53.577+00:00

Greetings!

I am developing a PowerShell module, and I'm getting errors while publishing it to the PSGalery.
Test-ModuleManifest is failing saying my manifest "is not a valid Windows PowerShell restricted language file."

238011-2022-09-05-20-27-27-psrepoapikeytxt-powershellcore.png

My session's language mode is set to "FullLanguage"

238001-2022-09-05-20-29-52-desktop.png

Tried looking everywhere, without success.
Does anyone knows what I am missing?

Thank you!

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,381 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Francisco Nabas 31 Reputation points
    2022-09-08T13:40:57.633+00:00

    Well, found the answer.
    I've created the manifest using New-ModuleManifest without any special parameters other than module info, and added the cmdlets on CmdletsToExport.
    That was wrong.
    Created the manifest using the instructions on this doc:

    https://learn.microsoft.com/en-us/powershell/scripting/dev-cross-plat/create-standard-library-binary-module?view=powershell-7.2

    $manifestSplat = @{  
        Path              = ".\$module\$module.psd1"  
        Author            = 'Kevin Marquette'  
        NestedModules     = @('bin\MyModule.dll')  
        RootModule        = "$module.psm1"  
        FunctionsToExport = @('Resolve-MyCmdlet')  
    }  
    New-ModuleManifest @manifestSplat  
    

    Hope it helps someone out there.

    Thanks!

    0 comments No comments