Import Errors

Jan 22, 2010 at 1:49 AM

I am getting the following Errors when attempting to import the modules - Anyones help will be greatly Appreciated - Thanks MNiazi

Import-Module : The module 'C:\Documents and Settings\MNiazi\My Documents\WindowsPowerShell\Modules\SQLServer\SQLServer.psd1' cannot be processed because it contains one or more invalid members. The valid module members are 'ModuleToProcess', 'NestedModules', 'GUID', 'Author', 'CompanyName', 'CopyRight', 'ModuleVersion', 'Description', 'PowerShellVersion', 'CLRVersion', 'RequiredModules', 'TypesToProcess', 'FormatsToProcess', 'ScriptsToProcess', 'PrivateData', 'RequiredAssemblies', 'OtherItems', 'ExportedFunctions', 'ExportedVariables', 'ExportedAliases', 'ExportedCmdlets'. Please remove the invalid member or members: 'VariablesToExport', 'PowerShellHostVersion', 'FileList', 'AliasesToExport', 'FunctionsToExport', 'PowerShellHostName', 'ModuleList', 'DotNetFrameworkVersion', 'CmdletsToExport', 'ProcessorArchitecture' then try reloading the manifest.
At line:1 char:14 + import-module <<<<  SQLServer
    + CategoryInfo          : InvalidData: (C:\Documents an...\SQLServer.psd1:String) [Import-Module], InvalidOperationException
    + FullyQualifiedErrorId : Modules_InvalidManifestMember,Microsoft.PowerShell.Commands.ImportModuleCommand
 

 get-module -listAvailable is returning the following msg

Get-Module : The module 'C:\Documents and Settings\MNiazi\My Documents\WindowsPowerShell\Modules\Agent\Agent.psd1' cannot be processed because it contains one or more  invalid members. The valid module members are 'ModuleToProcess', 'NestedModules', 'GUID', 'Author', 'CompanyName', 'CopyRight', 'ModuleVersion', 'Description', 'PowerShellVersion', 'CLRVersion', 'RequiredModules', 'TypesToProcess', 'FormatsToProcess', 'ScriptsToProcess', 'PrivateData', 'RequiredAssemblies', 'OtherItems', 'ExportedFunctions', 'ExportedVariables', 'ExportedAliases', 'ExportedCmdlets'. Please remove the invalid member or members: 'VariablesToExport', 'PowerShellHostVersion', 'FileList', 'AliasesToExport', 'FunctionsToExport', 'PowerShellHostName', 'ModuleList', 'DotNetFrameworkVersion', 'CmdletsToExport', 'ProcessorArchitecture' then try reloading the manifest.
At line:2 char:11 + get-module <<<<  -listAvailable
    + CategoryInfo          : InvalidData: (C:\Documents an...gent\Agent.psd1:String) [Get-Module], InvalidOperationException
    + FullyQualifiedErrorId : Modules_InvalidManifestMember,Microsoft.PowerShell.Commands.GetModuleCommand
 
Get-Module : The 'PowerShellVersion' member in the module manifest is invalid: Cannot convert value "" to type "System.Version". Error: "Version string portion was too short or too long." Please verify that the member is present and has a valid version string of the form n.n.n.n in the file 'C:\Documents and Settings\MNiazi\My Documents\WindowsPowerShell\Modules\Agent\Agent.psd1'.
At line:2 char:11+ get-module <<<<  -listAvailable
    + CategoryInfo          : ResourceUnavailable: (C:\Documents an...gent\Agent.psd1:String) [Get-Module], ArgumentException
    + FullyQualifiedErrorId : Modules_InvalidManifest,Microsoft.PowerShell.Commands.GetModuleCommand

 The $env:psmodulepath is returing the following - where i have copied the modules

C:\Documents and Settings\MNiazi\My Documents\WindowsPowerShell\Modules; C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules 

Coordinator
Jan 22, 2010 at 2:11 AM

What's the output of $psversiontable?

Jan 22, 2010 at 2:54 PM

Name                             Value                                                                                                                                 
----                                  -----                                                                                                                                 
CLRVersion                     2.0.50727.3603                                                                                                                        
BuildVersion                    6.1.6949.0                                                                                                                            
PSVersion                       2.0                                                                                                                                   
PSCompatibleVersions     {1.0, 2.0}

Coordinator
Jan 23, 2010 at 12:26 PM

Mniazi -- It looks like you are using an older pre-release (CTP3) version of Powershell 2. There are breaking changes in modules between CTP and RTM. Install the RTM version from http://support.microsoft.com/kb/968929 

Jan 23, 2010 at 11:13 PM

I installed the RTM version and have imported the modules. Thanks for all your help