cancel
Showing results for 
Search instead for 
Did you mean: 

Powershell access to folder for coping of files to users system

DennisSaratech
Resident

Powershell access to folder for coping of files to users system

Jump to solution

I am using Powershell to make backup files and copying new files to the PC. I can get Powershell to copy the files to the pc but I also need to get a listing of the files on the eEnyte drive using Powershell commands. I have the Egnyte Desktop App installed so I can map a drive letter to the Egnyte drive. Can you give me the Powershell syntax to pull a listing of the files into a variable? 

Thanks

Labels (2)
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
Xiakit
Resident

Re: Powershell access to folder for coping of files to users system

Jump to solution

This question was already answered, but i'd like to provide the "full" powershell answer :)

#Getting all the files in your Z:
$Files = Get-ChildItem -Recurse -Path Z:

# Removing everything from $Files and preserving only the fullpath of the file, then writing it down to a file.
$Files | Select-Object -ExpandProperty Fullname | Out-File -Force C:\Temp\Files.txt

 

 

0 Kudos
3 Replies
Moderator Sagar
Moderator

Re: Powershell access to folder for coping of files to users system

Jump to solution

Dennis,

Thank you for writing to us: - 

You can achieve this using Egnyte Drive and running the Tree command from command prompt in Windows (Start > Run > Cmd). Ideally the same should work in the powershell too. But honestly, it has not been tested anytime.

Please use the following command.

tree Z:/ (Please note the drive letter needs to be changed to drive letter assigned by Egnyte Drive on your system)

You can also use the following command to get a txt output for this information:

tree z: /a /f >> c:\Users\username\Desktop\index.txt (Please replace the drive letter and username with actual drive letter and username)

Here Z is the drive letter which needs to be replaced by the actual drive letter used by you on your system for Egnyte Drive. 

The output will be printed to index.txt on Desktop.

Hope this helps.

Thanks

 

PS. Help others find answers by selecting "Accept as Solution" if a post answers your question."
0 Kudos
Xiakit
Resident

Re: Powershell access to folder for coping of files to users system

Jump to solution

This question was already answered, but i'd like to provide the "full" powershell answer :)

#Getting all the files in your Z:
$Files = Get-ChildItem -Recurse -Path Z:

# Removing everything from $Files and preserving only the fullpath of the file, then writing it down to a file.
$Files | Select-Object -ExpandProperty Fullname | Out-File -Force C:\Temp\Files.txt

 

 

0 Kudos
Highlighted
Moderator Sagar
Moderator

Re: Powershell access to folder for coping of files to users system

Jump to solution

Hello @Xiakit,

Thank you for adding on your output to this response thread. We appreciate you inputs and encourage you to keep sharing your thoughts with the community.

Thanks.

PS. Help others find answers by selecting "Accept as Solution" if a post answers your question."
0 Kudos