PowerShell LiveCast: ..FileSystemAccessRule Error

Comments

5 comments

  • Tom Maleski

    This is the error message:

    Method invocation failed because [System.Security.AccessControl.FileSystemAccessRule] does not contain a
    method named 'new'.

    0
    Comment actions Permalink
  • Colby Bouma

    Make sure to put "new" before the parenthesis:

    0
    Comment actions Permalink
  • Tom Maleski

    0
    Comment actions Permalink
  • Colby Bouma

    Ah, you need an = after $newrule.

    $newrule = [System.Security.AccessControl.FileSystemAccessRule]::new(

    0
    Comment actions Permalink
  • Tom Maleski

    still the same, maybe its a PS Version issue? It works on another machine with PSVersion 5...

    I downloaded NTFSSecurity and getting better results.

    0
    Comment actions Permalink

Please sign in to leave a comment.