July 2018
Beginner
552 pages
13h 18m
English
Another addition of JEA in Windows PowerShell is the user drive. Even if the filesystem provider is not visible to the user, it is possible to map each connecting user a personal drive. It is possible to copy data to and from the personal drive, to, for example, use it as input for a cmdlet:
# The user drive$sessionConfigurationOptions = @{ Path = '.\SessionConfig.pssc' SessionType = 'RestrictedRemoteServer' TranscriptDirectory = 'C:\Transcripts' RunAsVirtualAccount = $true LanguageMode = 'ConstrainedLanguage' MountUserDrive = $true UserDriveMaximumSize = 50MB}New-PSSessionConfigurationFile @sessionConfigurationOptionsRegister-PSSessionConfiguration -Name WithUserDrive -Path .\SessionConfig.pssc# Copying files simply works.# Working ...Read now
Unlock full access