System.IO.FileSystemInfo - isInheritanceBlocked ScriptProperty

Enrico Giacomin 26 Reputation points
2025-05-16T07:41:11.6+00:00

Goodmorning.

$folders = Get-ChildItem -Directory -Path "C:\Folders"

My collegue (Same machine, both are admins) can see this method

$folders[0].isInheritanceBlocked (Boolean)

I don't.

Could you tell me why and how can I see the method (I saw it is a ScriptProperty)
Thanks a lot.

Enrico

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

Accepted answer
  1. MotoX80 36,536 Reputation points
    2025-05-16T13:25:26.16+00:00

    Your collegue must have installed a module that extends the properties but did it only for his account.

    Both of you should run Get-Module to see what modules are available. (Add the -All switch if you don't see a difference.)

    You can install a module for all users by adding the Scope switch.

    Install-Module -Scope AllUsers
    

    https://learn.microsoft.com/en-us/powershell/scripting/developer/cmdlet/extending-properties-for-objects?view=powershell-7.5#script-properties

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.