Skip to content

Add-AccountToDockerAccess fails in pwsh 7.0 #4

@epvanhouten

Description

@epvanhouten

When running in pwsh 7.0 the following errors are generated:

InvalidOperation: C:\Users\CpUser\Documents\PowerShell\Modules\dockeraccesshelper\0.0.3\Add-AccountToDockerAccess.psm1:65
Line |
  65 |      $dSec = $dInfo.GetAccessControl()
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Method invocation failed because [System.IO.DirectoryInfo] does not contain a method named
     | 'GetAccessControl'.

InvalidOperation: C:\Users\CpUser\Documents\PowerShell\Modules\dockeraccesshelper\0.0.3\Add-AccountToDockerAccess.psm1:67
Line |
  67 |      $dSec.AddAccessRule($rule)
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.

InvalidOperation: C:\Users\CpUser\Documents\PowerShell\Modules\dockeraccesshelper\0.0.3\Add-AccountToDockerAccess.psm1:68
Line |
  68 |      $dInfo.SetAccessControl($dSec)
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Method invocation failed because [System.IO.DirectoryInfo] does not contain a method named
     | 'SetAccessControl'.

My $PSVersionTable:

Name                           Value
----                           -----
PSVersion                      7.0.0
PSEdition                      Core
GitCommitId                    7.0.0
OS                             Microsoft Windows 10.0.17763
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Running Add-AccountToDockerAccess in a powershell session with version 5.1.17763.1007 runs to completion successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions