Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Object reference not set to an instance of an object #1

Open
MomoOne opened this issue Sep 9, 2019 · 0 comments
Open

Error: Object reference not set to an instance of an object #1

MomoOne opened this issue Sep 9, 2019 · 0 comments

Comments

@MomoOne
Copy link

MomoOne commented Sep 9, 2019

Hello,

When I want to import the module with the command
Import-Module -Name CMLimitingCollection -Verbose
I have this following error:

VERBOSE: Loading module from path 'C:\Program
Files\WindowsPowerShell\Modules\CMLimitingCollection\1.0\CMLimitingCollection.psd1'.
VERBOSE: Loading 'FormatsToProcess' from path 'C:\Program
Files\WindowsPowerShell\Modules\CMLimitingCollection\1.0\CMLimitingCollection.Format.ps1xml'.

Import-Module : Object reference not set to an instance of an object.
At line:1 char:1

  • Import-Module -Name CMLimitingCollection -Verbose
  •   + CategoryInfo          : InvalidOperation: (:) [Import-Module], NullReferenceException
      + FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand
    
    

The command Get-Module -ListAvailable gives me that:

Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version Name ExportedCommands


Script 1.0 CMLimitingCollection {Set-LimitingCollectionForFolder, ConvertTo-CMFolderPath}
Script 1.4.4 PackageManagement {Find-Package, Get-Package, Get-PackageProvider, Get-Packa..
Script 2.2.1 PowerShellGet {Find-Command, Find-DSCResource, Find-Module, Find-RoleCap..

...

That means the module is correctly installed.
In some forums they say I should disable the import of the ps1xml file. But in this case I even don't see anymore the CMLimitingCollection module.

Is it normal that the file "CMLimitingCollection.Format.ps1xml" is empty ?

Thank you in advance for your answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant