raandree / NTFSSecurity

Managing permissions with PowerShell is only a bit easier than in VBS or the command line as there are no cmdlets for most day-to-day tasks like getting a permission report or adding permission to an item. PowerShell only offers Get-Acl and Set-Acl but everything in between getting and setting the ACL is missing. This module closes the gap.
MIT License
431 stars 61 forks source link

Error in TypeData "System.IO.FileInfo": The member Size is already present. #82

Open sourcedelica opened 2 years ago

sourcedelica commented 2 years ago

Trying to import the module I get the following error:

PS C:\Users\EPederson> Import-Module NTFSSecurity
Import-Module : The following error occurred while loading the extended type data file: Error in TypeData "System.IO.FileInfo": The member Size is
already present.
At line:1 char:1
+ Import-Module NTFSSecurity
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Import-Module], RuntimeException
    + FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

I tracked this down to a conflict with PSScriptTools and as a workaround I have forked this repo and removed the following lines from NTFSSecurity.types.ps1xml:

      <AliasProperty>
        <Name>Size</Name>
        <ReferencedMemberName>LengthOnDisk</ReferencedMemberName>
      </AliasProperty>