SMBShare PSSessionConfoguration Error

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Istvan Szarka Istvan Szarka 2 years, 5 months ago.

  • Author
    Posts
  • #16175
    Profile photo of Istvan Szarka
    Istvan Szarka
    Participant

    Hi,

    I'm trying to create a PS endpoint for the use of the SMBShare module. I create the PSSessionConfigurationFile and register it seccessfully, but when I try to enter a session using this config, I get this error that the C drive doesn't exist:

    Enter-PSSession : One or more errors occurred processing the module 'smbshare' specified in the InitialSessionState object used to create this runspace. See the ErrorRecords property for a 
    complete list of errors. The first error was: Cannot find drive. A drive with the name 'C' does not exist.
    At line:1 char:1
    + Enter-PSSession -ComputerName igep -ConfigurationName netadapter
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : OpenError: (:) [Enter-PSSession], RunspaceOpenModuleLoadException
        + FullyQualifiedErrorId : ErrorLoadingModulesOnRunspaceOpen
    

    Pretty interesting.

  • #16212
    Profile photo of Don Jones
    Don Jones
    Keymaster

    If you limited the configuration so that it can't load PSDrives, this can happen. The shell wants to start in a directory, but if it doesn't have a drive, it can't. And the SmbShare module in particular may have a dependency on being able to access a drive.

    Sessions with no drives are usually only accessible by Invoke-Command, which doesn't try to create a prompt. Although, again, if SmbShare has a dependency, you will have to satisfy it.

  • #16213
    Profile photo of Istvan Szarka
    Istvan Szarka
    Participant

    I never thought of it! I'll try it, thank you!

You must be logged in to reply to this topic.